diff options
author | Patrick McHardy <kaber@trash.net> | 2010-02-27 05:52:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-27 05:52:05 -0500 |
commit | 8d6184e4881b423522136aeb3ec1cbd9c35e8813 (patch) | |
tree | fc9c33ee44e199b65d0e619a6ced118f8f0bbec3 /drivers | |
parent | 3729d5021257b283f7fce33d957893162ccb2c9d (diff) |
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 1787e3c86573..430c02267d7e 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) | |||
4946 | } | 4946 | } |
4947 | 4947 | ||
4948 | res = register_netdevice(bond_dev); | 4948 | res = register_netdevice(bond_dev); |
4949 | if (res < 0) | ||
4950 | goto out_netdev; | ||
4949 | 4951 | ||
4950 | out: | 4952 | out: |
4951 | rtnl_unlock(); | 4953 | rtnl_unlock(); |