projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aec9db3
)
6LoWPAN: call dev_put() on error in lowpan_newlink()
author
Dan Carpenter
<error27@gmail.com>
Tue, 30 Aug 2011 03:51:09 +0000
(
03:51
+0000)
committer
David S. Miller
<davem@davemloft.net>
Thu, 15 Sep 2011 19:36:32 +0000
(15:36 -0400)
We should release the dev_hold() on error before returning here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan.c
patch
|
blob
|
history
diff --git
a/net/ieee802154/6lowpan.c
b/net/ieee802154/6lowpan.c
index 5dc04890e0c5fed14357fea2ea51210d7e55841f..f0d15365722ad553b302044f2e0e2a8f00d14989 100644
(file)
--- a/
net/ieee802154/6lowpan.c
+++ b/
net/ieee802154/6lowpan.c
@@
-793,8
+793,11
@@
static int lowpan_newlink(struct net *src_net, struct net_device *dev,
mutex_init(&lowpan_dev_info(dev)->dev_list_mtx);
entry = kzalloc(sizeof(struct lowpan_dev_record), GFP_KERNEL);
- if (!entry)
+ if (!entry) {
+ dev_put(real_dev);
+ lowpan_dev_info(dev)->real_dev = NULL;
return -ENOMEM;
+ }
entry->ldev = dev;