diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-27 08:43:19 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 08:54:14 +0400 |
commit | e05273341c573f7b543f45c06e4a232c5b7c5a59 (patch) | |
tree | 028f2698f721ecc7145224f0fb45ecf71623227b /drivers/infiniband | |
parent | 01f534d0ae9d7b3ad4dcd943d53418731da82ea7 (diff) | |
download | linux-e05273341c573f7b543f45c06e4a232c5b7c5a59.tar.xz |
infiniband: netlink: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/netlink.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c index e497dfbee435..1e691dca1820 100644 --- a/drivers/infiniband/core/netlink.c +++ b/drivers/infiniband/core/netlink.c @@ -108,12 +108,14 @@ void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq, unsigned char *prev_tail; prev_tail = skb_tail_pointer(skb); - *nlh = NLMSG_NEW(skb, 0, seq, RDMA_NL_GET_TYPE(client, op), - len, NLM_F_MULTI); + *nlh = nlmsg_put(skb, 0, seq, RDMA_NL_GET_TYPE(client, op), + len, NLM_F_MULTI); + if (!*nlh) + goto out_nlmsg_trim; (*nlh)->nlmsg_len = skb_tail_pointer(skb) - prev_tail; - return NLMSG_DATA(*nlh); + return nlmsg_data(*nlh); -nlmsg_failure: +out_nlmsg_trim: nlmsg_trim(skb, prev_tail); return NULL; } |