summaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorZhang Changzhong <zhangchangzhong@huawei.com>2020-12-02 17:58:42 +0800
committerJakub Kicinski <kuba@kernel.org>2020-12-02 18:04:02 -0800
commit832e09798c261cf58de3a68cfcc6556408c16a5a (patch)
tree49fb96397fe83330bbaf74012e0f1ccafbc044a2 /drivers/net/vxlan.c
parentaba84871bd4f52c4dfcf3ad5d4501a6c9d2de90e (diff)
downloadlinux-832e09798c261cf58de3a68cfcc6556408c16a5a.tar.gz
linux-832e09798c261cf58de3a68cfcc6556408c16a5a.tar.bz2
linux-832e09798c261cf58de3a68cfcc6556408c16a5a.zip
vxlan: fix error return code in __vxlan_dev_create()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 0ce1822c2a08 ("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>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 032f78261913..977f77e2c2ce 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3880,8 +3880,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)