1
0
Fork 0

vxlan: fix error return code in __vxlan_dev_create()

[ Upstream commit 832e09798c ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 0ce1822c2a ("vxlan: add adjacent link to limit depth level")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1606903122-2098-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Zhang Changzhong 2020-12-02 17:58:42 +08:00 committed by Greg Kroah-Hartman
parent 5405a299b8
commit 178da08f9b
1 changed files with 3 additions and 1 deletions

View File

@ -3617,8 +3617,10 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev,
if (dst->remote_ifindex) {
remote_dev = __dev_get_by_index(net, dst->remote_ifindex);
if (!remote_dev)
if (!remote_dev) {
err = -ENODEV;
goto errout;
}
err = netdev_upper_dev_link(remote_dev, dev, extack);
if (err)