summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuguoqiang <liuguoqiang@uniontech.com>2021-11-15 11:14:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-08 11:01:09 +0300
commit96274948989ceb889f96017060fb1161d8cf40c8 (patch)
treefb7270c3eb033ece03a27a11fe0fbb0eeb2fd0ff
parent89d15a2e40d7edaaa16da2763b349dd7b056cc09 (diff)
downloadlinux-96274948989ceb889f96017060fb1161d8cf40c8.tar.xz
net: return correct error code
[ Upstream commit 6def480181f15f6d9ec812bca8cbc62451ba314c ] When kmemdup called failed and register_net_sysctl return NULL, should return ENOMEM instead of ENOBUFS Signed-off-by: liuguoqiang <liuguoqiang@uniontech.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/ipv4/devinet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 603a3495afa6..4a8ad46397c0 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -2585,7 +2585,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 net *net,