aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/netfilter/dn_rtmsg.c20
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
56nlmsg_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
64static void dnrmg_send_peer(struct sk_buff *skb) 64static void dnrmg_send_peer(struct sk_buff *skb)