summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-10 13:21:53 -0700
committerDavid S. Miller <davem@davemloft.net>2006-05-10 13:21:53 -0700
commitac05202e8b83594bf6797d241371e6c752f371e6 (patch)
tree4e75d1f6b14b6b0d3700a00f964a7eaadd04b8f9 /net
parentb17a7c179dd3ce7d04373fddf660eda21efc9db9 (diff)
downloadblackbird-op-linux-ac05202e8b83594bf6797d241371e6c752f371e6.tar.gz
blackbird-op-linux-ac05202e8b83594bf6797d241371e6c752f371e6.zip
[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: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_if.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 59eef42d4a42..ad1c7af65ec8 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -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)
OpenPOWER on IntegriCloud