Skip to content

Commit

Permalink
vxlan: fix error return code in __vxlan_dev_create()
Browse files Browse the repository at this point in the history
[ Upstream commit 832e097 ]

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

Fixes: 0ce1822 ("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>
  • Loading branch information
Zhang Changzhong authored and gregkh committed Dec 8, 2020
1 parent b6f2d8c commit 1f8846e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3881,8 +3881,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)
Expand Down

0 comments on commit 1f8846e

Please sign in to comment.