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>
This commit is contained in:
committed by
Jeff Garzik
parent
e4b91c4846
commit
09c8927976
@@ -4756,14 +4756,19 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
|
|||||||
|
|
||||||
rtnl_unlock(); /* allows sysfs registration of net device */
|
rtnl_unlock(); /* allows sysfs registration of net device */
|
||||||
res = bond_create_sysfs_entry(bond_dev->priv);
|
res = bond_create_sysfs_entry(bond_dev->priv);
|
||||||
goto done;
|
if (res < 0) {
|
||||||
|
rtnl_lock();
|
||||||
|
goto out_bond;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
out_bond:
|
out_bond:
|
||||||
bond_deinit(bond_dev);
|
bond_deinit(bond_dev);
|
||||||
out_netdev:
|
out_netdev:
|
||||||
free_netdev(bond_dev);
|
free_netdev(bond_dev);
|
||||||
out_rtnl:
|
out_rtnl:
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
done:
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user