aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a1607bc0cd4c..582963077877 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -903,7 +903,11 @@ int dev_change_name(struct net_device *dev, char *newname)
903 strlcpy(dev->name, newname, IFNAMSIZ); 903 strlcpy(dev->name, newname, IFNAMSIZ);
904 904
905rollback: 905rollback:
906 device_rename(&dev->dev, dev->name); 906 err = device_rename(&dev->dev, dev->name);
907 if (err) {
908 memcpy(dev->name, oldname, IFNAMSIZ);
909 return err;
910 }
907 911
908 write_lock_bh(&dev_base_lock); 912 write_lock_bh(&dev_base_lock);
909 hlist_del(&dev->name_hlist); 913 hlist_del(&dev->name_hlist);
@@ -3137,7 +3141,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
3137 * Load in the correct multicast list now the flags have changed. 3141 * Load in the correct multicast list now the flags have changed.
3138 */ 3142 */
3139 3143
3140 if (dev->change_rx_flags && (dev->flags ^ flags) & IFF_MULTICAST) 3144 if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST)
3141 dev->change_rx_flags(dev, IFF_MULTICAST); 3145 dev->change_rx_flags(dev, IFF_MULTICAST);
3142 3146
3143 dev_set_rx_mode(dev); 3147 dev_set_rx_mode(dev);