aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-10-20 02:33:56 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-20 02:33:56 -0400
commit92845ffd2a221f9f90b064ac55bb010bf27a193f (patch)
tree5679281371a62d229c1ebb9ad6f9d59ffdeb014a /net
parent0537ae6a3d7d6d9005446ee6419272fd4c38a58d (diff)
netdev: change name dropping error codes
If changename notifier returns an error code, it gets incorrectly cleared during rollback so the error is never returned to the user. Found while testing similar code for MTU changes. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 868ec0ba8b77..b8a4fd0806af 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -924,10 +924,10 @@ int dev_change_name(struct net_device *dev, const char *newname)
924 strlcpy(dev->name, newname, IFNAMSIZ); 924 strlcpy(dev->name, newname, IFNAMSIZ);
925 925
926rollback: 926rollback:
927 err = device_rename(&dev->dev, dev->name); 927 ret = device_rename(&dev->dev, dev->name);
928 if (err) { 928 if (ret) {
929 memcpy(dev->name, oldname, IFNAMSIZ); 929 memcpy(dev->name, oldname, IFNAMSIZ);
930 return err; 930 return ret;
931 } 931 }
932 932
933 write_lock_bh(&dev_base_lock); 933 write_lock_bh(&dev_base_lock);