aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/netlink.c12
-rw-r--r--net/ieee802154/nl-mac.c3
-rw-r--r--net/ieee802154/nl-phy.c3
-rw-r--r--net/ieee802154/nl802154.c6
4 files changed, 10 insertions, 14 deletions
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c
index fa1464762d0d..c8133c07ceee 100644
--- a/net/ieee802154/netlink.c
+++ b/net/ieee802154/netlink.c
@@ -63,13 +63,9 @@ int ieee802154_nl_mcast(struct sk_buff *msg, unsigned int group)
63 struct nlmsghdr *nlh = nlmsg_hdr(msg); 63 struct nlmsghdr *nlh = nlmsg_hdr(msg);
64 void *hdr = genlmsg_data(nlmsg_data(nlh)); 64 void *hdr = genlmsg_data(nlmsg_data(nlh));
65 65
66 if (genlmsg_end(msg, hdr) < 0) 66 genlmsg_end(msg, hdr);
67 goto out;
68 67
69 return genlmsg_multicast(&nl802154_family, msg, 0, group, GFP_ATOMIC); 68 return genlmsg_multicast(&nl802154_family, msg, 0, group, GFP_ATOMIC);
70out:
71 nlmsg_free(msg);
72 return -ENOBUFS;
73} 69}
74 70
75struct sk_buff *ieee802154_nl_new_reply(struct genl_info *info, 71struct sk_buff *ieee802154_nl_new_reply(struct genl_info *info,
@@ -96,13 +92,9 @@ int ieee802154_nl_reply(struct sk_buff *msg, struct genl_info *info)
96 struct nlmsghdr *nlh = nlmsg_hdr(msg); 92 struct nlmsghdr *nlh = nlmsg_hdr(msg);
97 void *hdr = genlmsg_data(nlmsg_data(nlh)); 93 void *hdr = genlmsg_data(nlmsg_data(nlh));
98 94
99 if (genlmsg_end(msg, hdr) < 0) 95 genlmsg_end(msg, hdr);
100 goto out;
101 96
102 return genlmsg_reply(msg, info); 97 return genlmsg_reply(msg, info);
103out:
104 nlmsg_free(msg);
105 return -ENOBUFS;
106} 98}
107 99
108static const struct genl_ops ieee8021154_ops[] = { 100static const struct genl_ops ieee8021154_ops[] = {
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
index 3c902e9516fb..9105265920fe 100644
--- a/net/ieee802154/nl-mac.c
+++ b/net/ieee802154/nl-mac.c
@@ -136,7 +136,8 @@ static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 portid,
136 } 136 }
137 137
138 wpan_phy_put(phy); 138 wpan_phy_put(phy);
139 return genlmsg_end(msg, hdr); 139 genlmsg_end(msg, hdr);
140 return 0;
140 141
141nla_put_failure: 142nla_put_failure:
142 wpan_phy_put(phy); 143 wpan_phy_put(phy);
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 7baf98b14611..1b9d25f6e898 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -65,7 +65,8 @@ static int ieee802154_nl_fill_phy(struct sk_buff *msg, u32 portid,
65 goto nla_put_failure; 65 goto nla_put_failure;
66 mutex_unlock(&phy->pib_lock); 66 mutex_unlock(&phy->pib_lock);
67 kfree(buf); 67 kfree(buf);
68 return genlmsg_end(msg, hdr); 68 genlmsg_end(msg, hdr);
69 return 0;
69 70
70nla_put_failure: 71nla_put_failure:
71 mutex_unlock(&phy->pib_lock); 72 mutex_unlock(&phy->pib_lock);
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index a25b9bbd077b..a4daf91b8d0a 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -306,7 +306,8 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,
306 goto nla_put_failure; 306 goto nla_put_failure;
307 307
308finish: 308finish:
309 return genlmsg_end(msg, hdr); 309 genlmsg_end(msg, hdr);
310 return 0;
310 311
311nla_put_failure: 312nla_put_failure:
312 genlmsg_cancel(msg, hdr); 313 genlmsg_cancel(msg, hdr);
@@ -489,7 +490,8 @@ nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags,
489 if (nla_put_u8(msg, NL802154_ATTR_LBT_MODE, wpan_dev->lbt)) 490 if (nla_put_u8(msg, NL802154_ATTR_LBT_MODE, wpan_dev->lbt))
490 goto nla_put_failure; 491 goto nla_put_failure;
491 492
492 return genlmsg_end(msg, hdr); 493 genlmsg_end(msg, hdr);
494 return 0;
493 495
494nla_put_failure: 496nla_put_failure:
495 genlmsg_cancel(msg, hdr); 497 genlmsg_cancel(msg, hdr);