Commit ac05202e authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[BRIDGE]: Do sysfs registration inside rtnl.

Now that netdevice sysfs registration is done as part of
register_netdevice; bridge code no longer has to be tricky when adding
it's kobjects to bridges.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b17a7c17
...@@ -308,26 +308,19 @@ int br_add_bridge(const char *name) ...@@ -308,26 +308,19 @@ int br_add_bridge(const char *name)
if (ret) if (ret)
goto err2; goto err2;
/* network device kobject is not setup until
* after rtnl_unlock does it's hotplug magic.
* so hold reference to avoid race.
*/
dev_hold(dev);
rtnl_unlock();
ret = br_sysfs_addbr(dev); ret = br_sysfs_addbr(dev);
dev_put(dev);
if (ret) if (ret)
unregister_netdev(dev); goto err3;
out: rtnl_unlock();
return ret; return 0;
err3:
unregister_netdev(dev);
err2: err2:
free_netdev(dev); free_netdev(dev);
err1: err1:
rtnl_unlock(); rtnl_unlock();
goto out; return ret;
} }
int br_del_bridge(const char *name) int br_del_bridge(const char *name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment