From: Stephen Hemminger Date: Mon, 20 Oct 2008 06:33:56 +0000 (-0700) Subject: netdev: change name dropping error codes X-Git-Tag: upstream/snapshot3+hdmi~21900^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92845ffd2a221f9f90b064ac55bb010bf27a193f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 868ec0b..b8a4fd0 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);