mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 05:12:49 +00:00
net: propagate dev_get_valid_name return code
[ Upstream commit 7892bd0810
]
if dev_get_valid_name failed, propagate its return code
and remove the setting err to ENODEV, it will be set to
0 again before dev_change_net_namespace exits.
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7694397e69
commit
53adf73655
1 changed files with 2 additions and 2 deletions
|
@ -7945,7 +7945,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
|
|||
/* We get here if we can't use the current device name */
|
||||
if (!pat)
|
||||
goto out;
|
||||
if (dev_get_valid_name(net, dev, pat) < 0)
|
||||
err = dev_get_valid_name(net, dev, pat);
|
||||
if (err < 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -7957,7 +7958,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
|
|||
dev_close(dev);
|
||||
|
||||
/* And unlink it from device chain */
|
||||
err = -ENODEV;
|
||||
unlist_netdevice(dev);
|
||||
|
||||
synchronize_net();
|
||||
|
|
Loading…
Reference in a new issue