Skip to content

Commit

Permalink
[BRIDGE]: Do sysfs registration inside rtnl.
Browse files Browse the repository at this point in the history
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: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed May 10, 2006
1 parent b17a7c1 commit ac05202
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,26 +308,19 @@ int br_add_bridge(const char *name)
if (ret)
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);
dev_put(dev);

if (ret)
unregister_netdev(dev);
out:
return ret;
if (ret)
goto err3;
rtnl_unlock();
return 0;

err3:
unregister_netdev(dev);
err2:
free_netdev(dev);
err1:
rtnl_unlock();
goto out;
return ret;
}

int br_del_bridge(const char *name)
Expand Down

0 comments on commit ac05202

Please sign in to comment.