diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-10-19 23:33:56 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-19 23:33:56 -0700 |
commit | 92845ffd2a221f9f90b064ac55bb010bf27a193f (patch) | |
tree | 5679281371a62d229c1ebb9ad6f9d59ffdeb014a | |
parent | 0537ae6a3d7d6d9005446ee6419272fd4c38a58d (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>
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 868ec0ba8b7..b8a4fd0806a 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) strlcpy(dev->name, newname, IFNAMSIZ); rollback: - err = device_rename(&dev->dev, dev->name); - if (err) { + ret = device_rename(&dev->dev, dev->name); + if (ret) { memcpy(dev->name, oldname, IFNAMSIZ); - return err; + return ret; } write_lock_bh(&dev_base_lock); |