From: Stephen Hemminger Date: Mon, 20 Oct 2008 06:33:56 +0000 (-0700) Subject: netdev: change name dropping error codes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=92845ffd2a221f9f90b064ac55bb010bf27a193f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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);