diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-27 00:25:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 00:25:55 -0400 |
commit | 77ca4ed566cdef855bc63d0f4cf4d034182d5ebd (patch) | |
tree | bf7e5cf366dbd3f86966b22a5f783de9995c1a22 /net/decnet | |
parent | 62566ca55de3a329ef2569d7e7c9d0a326abede2 (diff) |
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/decnet')
-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) | |||
42 | size = NLMSG_SPACE(rt_skb->len); | 42 | size = NLMSG_SPACE(rt_skb->len); |
43 | size += NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)); | 43 | size += NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)); |
44 | skb = alloc_skb(size, GFP_ATOMIC); | 44 | skb = alloc_skb(size, GFP_ATOMIC); |
45 | if (!skb) | 45 | if (!skb) { |
46 | goto nlmsg_failure; | 46 | *errp = -ENOMEM; |
47 | return NULL; | ||
48 | } | ||
47 | old_tail = skb->tail; | 49 | old_tail = skb->tail; |
48 | nlh = NLMSG_PUT(skb, 0, 0, 0, size - sizeof(*nlh)); | 50 | nlh = nlmsg_put(skb, 0, 0, 0, size - sizeof(*nlh), 0); |
51 | if (!nlh) { | ||
52 | kfree_skb(skb); | ||
53 | *errp = -ENOMEM; | ||
54 | return NULL; | ||
55 | } | ||
49 | rtm = (struct nf_dn_rtmsg *)NLMSG_DATA(nlh); | 56 | rtm = (struct nf_dn_rtmsg *)NLMSG_DATA(nlh); |
50 | rtm->nfdn_ifindex = rt_skb->dev->ifindex; | 57 | rtm->nfdn_ifindex = rt_skb->dev->ifindex; |
51 | ptr = NFDN_RTMSG(rtm); | 58 | ptr = NFDN_RTMSG(rtm); |
52 | skb_copy_from_linear_data(rt_skb, ptr, rt_skb->len); | 59 | skb_copy_from_linear_data(rt_skb, ptr, rt_skb->len); |
53 | nlh->nlmsg_len = skb->tail - old_tail; | 60 | nlh->nlmsg_len = skb->tail - old_tail; |
54 | return skb; | 61 | return skb; |
55 | |||
56 | nlmsg_failure: | ||
57 | if (skb) | ||
58 | kfree_skb(skb); | ||
59 | *errp = -ENOMEM; | ||
60 | net_err_ratelimited("dn_rtmsg: error creating netlink message\n"); | ||
61 | return NULL; | ||
62 | } | 62 | } |
63 | 63 | ||
64 | static void dnrmg_send_peer(struct sk_buff *skb) | 64 | static void dnrmg_send_peer(struct sk_buff *skb) |