[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210607144422.2848809-1-zhengyongjun3@huawei.com>
Date: Mon, 7 Jun 2021 22:44:22 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH net-next] vxlan: Return the correct errno code
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUFS.
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
drivers/net/vxlan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 02a14f1b938a..5fa7250edf5c 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -711,11 +711,11 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
rd = kmalloc(sizeof(*rd), GFP_ATOMIC);
if (rd == NULL)
- return -ENOBUFS;
+ return -ENOMEM;
if (dst_cache_init(&rd->dst_cache, GFP_ATOMIC)) {
kfree(rd);
- return -ENOBUFS;
+ return -ENOMEM;
}
rd->remote_ip = *ip;
--
2.25.1
Powered by blists - more mailing lists