diff options
author | Jiri Pirko <jpirko@redhat.com> | 2009-05-01 18:35:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-01 18:35:28 -0400 |
commit | 1363d9b135270662852ed2e6629fb79a36de5400 (patch) | |
tree | a6096ea7df039de6c40bd900edba2f9b7fc4db5c | |
parent | c047fcd245975f40312ed57bf43e7d4abd188e6b (diff) |
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>
-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) | |||
5158 | up_write(&bonding_rwsem); | 5158 | up_write(&bonding_rwsem); |
5159 | rtnl_unlock(); /* allows sysfs registration of net device */ | 5159 | rtnl_unlock(); /* allows sysfs registration of net device */ |
5160 | res = bond_create_sysfs_entry(netdev_priv(bond_dev)); | 5160 | res = bond_create_sysfs_entry(netdev_priv(bond_dev)); |
5161 | if (res < 0) { | 5161 | if (res < 0) |
5162 | rtnl_lock(); | 5162 | goto out_unreg; |
5163 | down_write(&bonding_rwsem); | ||
5164 | bond_deinit(bond_dev); | ||
5165 | unregister_netdevice(bond_dev); | ||
5166 | goto out_rtnl; | ||
5167 | } | ||
5168 | 5163 | ||
5169 | return 0; | 5164 | return 0; |
5170 | 5165 | ||
5166 | out_unreg: | ||
5167 | rtnl_lock(); | ||
5168 | down_write(&bonding_rwsem); | ||
5169 | unregister_netdevice(bond_dev); | ||
5171 | out_bond: | 5170 | out_bond: |
5172 | bond_deinit(bond_dev); | 5171 | bond_deinit(bond_dev); |
5173 | out_netdev: | 5172 | out_netdev: |