lkml.org 
[lkml]   [2021]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net-next] net: core: Return the correct errno code
Date
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
net/core/rtnetlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7d7223691783..6df8fb25668b 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -177,7 +177,7 @@ static int rtnl_register_internal(struct module *owner,
struct rtnl_link *link, *old;
struct rtnl_link __rcu **tab;
int msgindex;
- int ret = -ENOBUFS;
+ int ret = -ENOMEM;

BUG_ON(protocol < 0 || protocol > RTNL_FAMILY_MAX);
msgindex = rtm_msgindex(msgtype);
--
2.22.0
\
 
 \ /
  Last update: 2021-02-04 04:21    [W:0.047 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site