aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d44b8f1964fa..4dc93cc4d5b7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -751,13 +751,10 @@ int dev_change_name(struct net_device *dev, char *newname)
751 else 751 else
752 strlcpy(dev->name, newname, IFNAMSIZ); 752 strlcpy(dev->name, newname, IFNAMSIZ);
753 753
754 err = device_rename(&dev->dev, dev->name); 754 device_rename(&dev->dev, dev->name);
755 if (!err) { 755 hlist_del(&dev->name_hlist);
756 hlist_del(&dev->name_hlist); 756 hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name));
757 hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); 757 raw_notifier_call_chain(&netdev_chain, NETDEV_CHANGENAME, dev);
758 raw_notifier_call_chain(&netdev_chain,
759 NETDEV_CHANGENAME, dev);
760 }
761 758
762 return err; 759 return err;
763} 760}