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

From: Zheng Yongjun
Date: Thu Feb 04 2021 - 02:29:42 EST


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

Signed-off-by: Zheng Yongjun <zhengyongjun3@xxxxxxxxxx>
---
net/ipv6/addrconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8b6eb384bac7..347b95bc00fd 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -6943,7 +6943,7 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name,
free:
kfree(table);
out:
- return -ENOBUFS;
+ return -ENOMEM;
}

static void __addrconf_sysctl_unregister(struct net *net,
--
2.22.0