Skip to content

Commit

Permalink
bonding: fix error check in sysfs creation
Browse files Browse the repository at this point in the history
	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>
  • Loading branch information
Jay Vosburgh authored and Jeff Garzik committed Feb 5, 2007
1 parent e4b91c4 commit 09c8927
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4756,14 +4756,19 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond

rtnl_unlock(); /* allows sysfs registration of net device */
res = bond_create_sysfs_entry(bond_dev->priv);
goto done;
if (res < 0) {
rtnl_lock();
goto out_bond;
}

return 0;

out_bond:
bond_deinit(bond_dev);
out_netdev:
free_netdev(bond_dev);
out_rtnl:
rtnl_unlock();
done:
return res;
}

Expand Down

0 comments on commit 09c8927

Please sign in to comment.