diff options
-rw-r--r-- | net/core/dev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 7bfea5e9030e..346cbf66534e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -839,8 +839,12 @@ int dev_change_name(struct net_device *dev, char *newname) | |||
839 | strlcpy(dev->name, newname, IFNAMSIZ); | 839 | strlcpy(dev->name, newname, IFNAMSIZ); |
840 | 840 | ||
841 | device_rename(&dev->dev, dev->name); | 841 | device_rename(&dev->dev, dev->name); |
842 | |||
843 | write_lock_bh(&dev_base_lock); | ||
842 | hlist_del(&dev->name_hlist); | 844 | hlist_del(&dev->name_hlist); |
843 | hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); | 845 | hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); |
846 | write_unlock_bh(&dev_base_lock); | ||
847 | |||
844 | raw_notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev); | 848 | raw_notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev); |
845 | 849 | ||
846 | return err; | 850 | return err; |