[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211126023701.443472-1-sashal@kernel.org>
Date: Thu, 25 Nov 2021 21:36:56 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: liuguoqiang <liuguoqiang@...ontech.com>,
"David S . Miller" <davem@...emloft.net>,
Sasha Levin <sashal@...nel.org>, yoshfuji@...ux-ipv6.org,
dsahern@...nel.org, kuba@...nel.org, netdev@...r.kernel.org
Subject: [PATCH AUTOSEL 4.4 1/6] net: return correct error code
From: liuguoqiang <liuguoqiang@...ontech.com>
[ Upstream commit 6def480181f15f6d9ec812bca8cbc62451ba314c ]
When kmemdup called failed and register_net_sysctl return NULL, should
return ENOMEM instead of ENOBUFS
Signed-off-by: liuguoqiang <liuguoqiang@...ontech.com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
net/ipv4/devinet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2cb8612e7821e..35961ae1d120c 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -2237,7 +2237,7 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
free:
kfree(t);
out:
- return -ENOBUFS;
+ return -ENOMEM;
}
static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
--
2.33.0
Powered by blists - more mailing lists