Commit 6ebf476f authored by Randy Dunlap's avatar Randy Dunlap Committed by David S. Miller

[NET]: Grab RTNL semaphore in init_netdev() if we call dev_alloc_name().

parent d8c3d545
...@@ -148,11 +148,14 @@ static struct net_device *init_netdev(struct net_device *dev, int sizeof_priv, ...@@ -148,11 +148,14 @@ static struct net_device *init_netdev(struct net_device *dev, int sizeof_priv,
if (dev->name[0] == '\0' || dev->name[0] == ' ') { if (dev->name[0] == '\0' || dev->name[0] == ' ') {
strcpy(dev->name, mask); strcpy(dev->name, mask);
rtnl_lock();
if (dev_alloc_name(dev, mask)<0) { if (dev_alloc_name(dev, mask)<0) {
rtnl_unlock();
if (new_device) if (new_device)
kfree(dev); kfree(dev);
return NULL; return NULL;
} }
rtnl_unlock();
} }
netdev_boot_setup_check(dev); netdev_boot_setup_check(dev);
......
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