aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
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)
308 if (ret) 308 if (ret)
309 goto err2; 309 goto err2;
310 310
311 /* network device kobject is not setup until
312 * after rtnl_unlock does it's hotplug magic.
313 * so hold reference to avoid race.
314 */
315 dev_hold(dev);
316 rtnl_unlock();
317
318 ret = br_sysfs_addbr(dev); 311 ret = br_sysfs_addbr(dev);
319 dev_put(dev); 312 if (ret)
320 313 goto err3;
321 if (ret) 314 rtnl_unlock();
322 unregister_netdev(dev); 315 return 0;
323 out:
324 return ret;
325 316
317 err3:
318 unregister_netdev(dev);
326 err2: 319 err2:
327 free_netdev(dev); 320 free_netdev(dev);
328 err1: 321 err1:
329 rtnl_unlock(); 322 rtnl_unlock();
330 goto out; 323 return ret;
331} 324}
332 325
333int br_del_bridge(const char *name) 326int br_del_bridge(const char *name)