diff options
author | Jiri Pirko <jpirko@redhat.com> | 2009-05-02 00:35:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-02 00:35:28 +0200 |
commit | 1363d9b135270662852ed2e6629fb79a36de5400 (patch) | |
tree | a6096ea7df039de6c40bd900edba2f9b7fc4db5c /drivers/net/bonding/bond_main.c | |
parent | virtio: add missing include to virtio_net.h (diff) | |
download | linux-1363d9b135270662852ed2e6629fb79a36de5400.tar.xz linux-1363d9b135270662852ed2e6629fb79a36de5400.zip |
bonding: correct the cleanup in bond_create()
This patch makes the cleanup in bond_create nicer :) Also now the forgotten
free_netdev is called.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 67515b78ff91..2188a96fc090 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -5158,16 +5158,15 @@ int bond_create(char *name, struct bond_params *params) up_write(&bonding_rwsem); rtnl_unlock(); /* allows sysfs registration of net device */ res = bond_create_sysfs_entry(netdev_priv(bond_dev)); - if (res < 0) { - rtnl_lock(); - down_write(&bonding_rwsem); - bond_deinit(bond_dev); - unregister_netdevice(bond_dev); - goto out_rtnl; - } + if (res < 0) + goto out_unreg; return 0; +out_unreg: + rtnl_lock(); + down_write(&bonding_rwsem); + unregister_netdevice(bond_dev); out_bond: bond_deinit(bond_dev); out_netdev: |