diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-10-20 08:33:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-20 08:33:56 +0200 |
commit | 92845ffd2a221f9f90b064ac55bb010bf27a193f (patch) | |
tree | 5679281371a62d229c1ebb9ad6f9d59ffdeb014a /net | |
parent | ipvs: Update CONFIG_IP_VS_IPV6 description and help text (diff) | |
download | linux-92845ffd2a221f9f90b064ac55bb010bf27a193f.tar.xz linux-92845ffd2a221f9f90b064ac55bb010bf27a193f.zip |
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.c | 6 |
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) 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); |