public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* bonding: fix device leak on error in bond_create()
@ 2010-02-26 15:35 Patrick McHardy
  2010-02-26 16:05 ` Andy Gospodarek
  2010-02-27 10:52 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Patrick McHardy @ 2010-02-26 15:35 UTC (permalink / raw)
  To: Linux Netdev List; +Cc: Jay Vosburgh

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 702 bytes --]

commit f357a5caa0ca29b74811a0fc08efb5ae4aade959
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Feb 25 20:21:10 2010 +0100

    bonding: fix device leak on error in bond_create()
    
    When the register_netdevice() call fails, the newly allocated device is
    not freed.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1787e3c..430c022 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4946,6 +4946,8 @@ int bond_create(struct net *net, const char *name)
 	}
 
 	res = register_netdevice(bond_dev);
+	if (res < 0)
+		goto out_netdev;
 
 out:
 	rtnl_unlock();

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-27 10:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-26 15:35 bonding: fix device leak on error in bond_create() Patrick McHardy
2010-02-26 16:05 ` Andy Gospodarek
2010-02-26 16:17   ` Patrick McHardy
2010-02-26 16:22     ` Andy Gospodarek
2010-02-27 10:52 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox