lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Aug 2011 16:51:09 +0300
From:	Dan Carpenter <error27@...il.com>
To:	Alexander Smirnov <alex.bluesman.smirnov@...il.com>
Cc:	Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
	Sergey Lapin <slapin@...fans.org>,
	"David S. Miller" <davem@...emloft.net>,
	"open list:IEEE 802.15.4 SUB..." 
	<linux-zigbee-devel@...ts.sourceforge.net>,
	"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: [patch 3/3 -next] 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@...il.com>
---
All three of these patches were compile tested only, but this is the
one I'm not very certain of.  I've obviously tried to get it right,
but please review it carefully.

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 5dc0489..f0d1536 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,
 	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;
 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ