aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-11-07 02:44:45 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-07 19:11:13 -0500
commit78032f9b3eae3a43da9468d8ce30caa6be84f89d (patch)
tree3eb96687bd577dba60c5afeaef4fef27c5715af1 /net/ieee802154
parenteb072c4b8da0ba87bc870c7911aae180bae34d4a (diff)
6lowpan: release device on error path
We recently added a new error path and it needs a dev_put(). Fixes: 7adac1ec8198 ('6lowpan: Only make 6lowpan links to IEEE802154 devices') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/6lowpan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 9497c6f3276b..426b5df1c98f 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1358,8 +1358,10 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
1358 real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); 1358 real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
1359 if (!real_dev) 1359 if (!real_dev)
1360 return -ENODEV; 1360 return -ENODEV;
1361 if (real_dev->type != ARPHRD_IEEE802154) 1361 if (real_dev->type != ARPHRD_IEEE802154) {
1362 dev_put(real_dev);
1362 return -EINVAL; 1363 return -EINVAL;
1364 }
1363 1365
1364 lowpan_dev_info(dev)->real_dev = real_dev; 1366 lowpan_dev_info(dev)->real_dev = real_dev;
1365 lowpan_dev_info(dev)->fragment_tag = 0; 1367 lowpan_dev_info(dev)->fragment_tag = 0;