[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1606903122-2098-1-git-send-email-zhangchangzhong@huawei.com>
Date: Wed, 2 Dec 2020 17:58:42 +0800
From: Zhang Changzhong <zhangchangzhong@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <ap420073@...il.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH net] 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@...wei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.com>
---
drivers/net/vxlan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 1a557ae..a506872 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3877,8 +3877,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)
--
2.9.5
Powered by blists - more mailing lists