diff options
author | liuguoqiang <liuguoqiang@uniontech.com> | 2021-11-15 11:14:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-08 11:01:09 +0300 |
commit | 96274948989ceb889f96017060fb1161d8cf40c8 (patch) | |
tree | fb7270c3eb033ece03a27a11fe0fbb0eeb2fd0ff | |
parent | 89d15a2e40d7edaaa16da2763b349dd7b056cc09 (diff) | |
download | linux-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.c | 2 |
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, |