aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-08-29 23:51:09 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-15 15:36:32 -0400
commitdc00fd44413e9d4310d0dc6bcc3bd8e57ba8f064 (patch)
treed3236757784b4428bf305ebb234819dec6405cd8
parentaec9db355ce2b930358ade5a71cc00ac258e1b3f (diff)
6LoWPAN: call dev_put() on error in lowpan_newlink()
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>
-rw-r--r--net/ieee802154/6lowpan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 5dc04890e0c5..f0d15365722a 100644
--- 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,
793 mutex_init(&lowpan_dev_info(dev)->dev_list_mtx); 793 mutex_init(&lowpan_dev_info(dev)->dev_list_mtx);
794 794
795 entry = kzalloc(sizeof(struct lowpan_dev_record), GFP_KERNEL); 795 entry = kzalloc(sizeof(struct lowpan_dev_record), GFP_KERNEL);
796 if (!entry) 796 if (!entry) {
797 dev_put(real_dev);
798 lowpan_dev_info(dev)->real_dev = NULL;
797 return -ENOMEM; 799 return -ENOMEM;
800 }
798 801
799 entry->ldev = dev; 802 entry->ldev = dev;
800 803