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

[BRIDGE]: Make delete bridge work with current unregister semantics.

parent 05d018c2
...@@ -170,11 +170,12 @@ int br_del_bridge(const char *name) ...@@ -170,11 +170,12 @@ int br_del_bridge(const char *name)
struct net_device *dev; struct net_device *dev;
int ret = 0; int ret = 0;
dev = dev_get_by_name(name); rtnl_lock();
dev = __dev_get_by_name(name);
if (dev == NULL) if (dev == NULL)
return -ENXIO; /* Could not find device */ ret = -ENXIO; /* Could not find device */
if (!(dev->priv_flags & IFF_EBRIDGE)) { else if (!(dev->priv_flags & IFF_EBRIDGE)) {
/* Attempt to delete non bridge device! */ /* Attempt to delete non bridge device! */
ret = -EPERM; ret = -EPERM;
} }
...@@ -186,11 +187,10 @@ int br_del_bridge(const char *name) ...@@ -186,11 +187,10 @@ int br_del_bridge(const char *name)
else { else {
del_ifs((struct net_bridge *) dev->priv); del_ifs((struct net_bridge *) dev->priv);
unregister_netdevice(dev);
unregister_netdev(dev);
} }
dev_put(dev); rtnl_unlock();
return ret; return ret;
} }
......
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