diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2007-01-19 21:15:38 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:47 -0500 |
commit | 09c892797688312dc8a3c4d8b37dcb7207c1d48a (patch) | |
tree | adf75f427842fdb6d112fb246133a7925b659165 /drivers/net/bonding | |
parent | e4b91c484611da385e34ff0f8bb2744ae2c735b7 (diff) |
bonding: fix error check in sysfs creation
The existing code did not correctly handle failures to create
the per-interface sysfs group for bonding.
Modified code to notice errors, and correctly unwind.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 07b9d1f65b66..d3801a00d3d5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4756,14 +4756,19 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond | |||
4756 | 4756 | ||
4757 | rtnl_unlock(); /* allows sysfs registration of net device */ | 4757 | rtnl_unlock(); /* allows sysfs registration of net device */ |
4758 | res = bond_create_sysfs_entry(bond_dev->priv); | 4758 | res = bond_create_sysfs_entry(bond_dev->priv); |
4759 | goto done; | 4759 | if (res < 0) { |
4760 | rtnl_lock(); | ||
4761 | goto out_bond; | ||
4762 | } | ||
4763 | |||
4764 | return 0; | ||
4765 | |||
4760 | out_bond: | 4766 | out_bond: |
4761 | bond_deinit(bond_dev); | 4767 | bond_deinit(bond_dev); |
4762 | out_netdev: | 4768 | out_netdev: |
4763 | free_netdev(bond_dev); | 4769 | free_netdev(bond_dev); |
4764 | out_rtnl: | 4770 | out_rtnl: |
4765 | rtnl_unlock(); | 4771 | rtnl_unlock(); |
4766 | done: | ||
4767 | return res; | 4772 | return res; |
4768 | } | 4773 | } |
4769 | 4774 | ||