* [patch] 6lowpan: release device on error path
@ 2013-11-07 7:44 Dan Carpenter
2013-11-07 8:17 ` [Linux-zigbee-devel] " Alexander Aring
2013-11-08 0:13 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2013-11-07 7:44 UTC (permalink / raw)
To: Alexander Smirnov, Alan Ott
Cc: Dmitry Eremin-Solenikov, David S. Miller, linux-zigbee-devel,
netdev, kernel-janitors
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>
---
Compile tested only. Please review carefully.
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 9497c6f..426b5df 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,
real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
if (!real_dev)
return -ENODEV;
- if (real_dev->type != ARPHRD_IEEE802154)
+ if (real_dev->type != ARPHRD_IEEE802154) {
+ dev_put(real_dev);
return -EINVAL;
+ }
lowpan_dev_info(dev)->real_dev = real_dev;
lowpan_dev_info(dev)->fragment_tag = 0;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Linux-zigbee-devel] [patch] 6lowpan: release device on error path
2013-11-07 7:44 [patch] 6lowpan: release device on error path Dan Carpenter
@ 2013-11-07 8:17 ` Alexander Aring
2013-11-08 0:13 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Aring @ 2013-11-07 8:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alexander Smirnov, Alan Ott, netdev, kernel-janitors,
David S. Miller, linux-zigbee-devel
On Thu, Nov 07, 2013 at 10:44:45AM +0300, Dan Carpenter wrote:
> 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>
> ---
> Compile tested only. Please review carefully.
>
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 9497c6f..426b5df 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,
> real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
> if (!real_dev)
> return -ENODEV;
> - if (real_dev->type != ARPHRD_IEEE802154)
> + if (real_dev->type != ARPHRD_IEEE802154) {
> + dev_put(real_dev);
> return -EINVAL;
> + }
looks correct for me.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] 6lowpan: release device on error path
2013-11-07 7:44 [patch] 6lowpan: release device on error path Dan Carpenter
2013-11-07 8:17 ` [Linux-zigbee-devel] " Alexander Aring
@ 2013-11-08 0:13 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-11-08 0:13 UTC (permalink / raw)
To: dan.carpenter
Cc: alex.bluesman.smirnov, alan, dbaryshkov, linux-zigbee-devel,
netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 7 Nov 2013 10:44:45 +0300
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-08 0:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 7:44 [patch] 6lowpan: release device on error path Dan Carpenter
2013-11-07 8:17 ` [Linux-zigbee-devel] " Alexander Aring
2013-11-08 0:13 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).