diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-26 21:25:55 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-26 21:25:55 -0700 |
commit | 77ca4ed566cdef855bc63d0f4cf4d034182d5ebd (patch) | |
tree | bf7e5cf366dbd3f86966b22a5f783de9995c1a22 /net | |
parent | 62566ca55de3a329ef2569d7e7c9d0a326abede2 (diff) | |
download | linux-77ca4ed566cdef855bc63d0f4cf4d034182d5ebd.tar.bz2 |
decnet: dn_rtmsg: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too.
Also, remove pointless kernel log message.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/decnet/netfilter/dn_rtmsg.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index e6f886255cde..b8f7f5b8c350 100644 --- a/net/decnet/netfilter/dn_rtmsg.c +++ b/net/decnet/netfilter/dn_rtmsg.c @@ -42,23 +42,23 @@ static struct sk_buff *dnrmg_build_message(struct sk_buff *rt_skb, int *errp) size = NLMSG_SPACE(rt_skb->len); size += NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)); skb = alloc_skb(size, GFP_ATOMIC); - if (!skb) - goto nlmsg_failure; + if (!skb) { + *errp = -ENOMEM; + return NULL; + } old_tail = skb->tail; - nlh = NLMSG_PUT(skb, 0, 0, 0, size - sizeof(*nlh)); + nlh = nlmsg_put(skb, 0, 0, 0, size - sizeof(*nlh), 0); + if (!nlh) { + kfree_skb(skb); + *errp = -ENOMEM; + return NULL; + } rtm = (struct nf_dn_rtmsg *)NLMSG_DATA(nlh); rtm->nfdn_ifindex = rt_skb->dev->ifindex; ptr = NFDN_RTMSG(rtm); skb_copy_from_linear_data(rt_skb, ptr, rt_skb->len); nlh->nlmsg_len = skb->tail - old_tail; return skb; - -nlmsg_failure: - if (skb) - kfree_skb(skb); - *errp = -ENOMEM; - net_err_ratelimited("dn_rtmsg: error creating netlink message\n"); - return NULL; } static void dnrmg_send_peer(struct sk_buff *skb) |