[PATCH net-next] net: Return the correct errno code

Subsystems: networking [general], the rest

STALE1896d

2 messages, 2 authors, 2021-06-02 · open the first message on its own page

[PATCH net-next] net: Return the correct errno code

From: Zheng Yongjun <hidden>
Date: 2021-06-01 14:00:34

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <redacted>
---
 net/ipv4/af_inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index f17870ee558b..6608a3c475e3 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -318,7 +318,7 @@ static int inet_create(struct net *net, struct socket *sock, int protocol,
 
 	WARN_ON(!answer_prot->slab);
 
-	err = -ENOBUFS;
+	err = -ENOMEM;
 	sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, kern);
 	if (!sk)
 		goto out;
-- 
2.25.1

Re: [PATCH net-next] net: Return the correct errno code

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-02 00:10:30

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 1 Jun 2021 22:14:07 +0800 you wrote:
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <redacted>
---
 net/ipv4/af_inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
  - [net-next] net: Return the correct errno code
    https://git.kernel.org/netdev/net-next/c/ca746c55a7e6

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help