infiniband: netlink: Move away from NLMSG_NEW().
authorDavid S. Miller <davem@davemloft.net>
Wed, 27 Jun 2012 04:43:19 +0000 (21:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Jun 2012 04:54:14 +0000 (21:54 -0700)
And use nlmsg_data() while we're here too.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/core/netlink.c

index e497dfbee4352c99b8fdafba40ccfa4aff1e367f..1e691dca1820d91e8d028aa7f029ad8b0f24b0de 100644 (file)
@@ -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;
 }