mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
net: propagate dev_get_valid_name return code
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>
This commit is contained in:
parent
56f772279a
commit
7892bd0810
@ -8643,7 +8643,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;
|
||||
}
|
||||
|
||||
@ -8655,7 +8656,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 New Issue
Block a user