summaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
authorliuguoqiang <liuguoqiang@uniontech.com>2021-11-15 09:14:48 +0100
committerDavid S. Miller <davem@davemloft.net>2021-11-15 15:22:12 +0100
commit6def480181f15f6d9ec812bca8cbc62451ba314c (patch)
treedbd7bb1eb07f56b30f5901706cb5c9a4afe51ec9 /net/ipv4/devinet.c
parentnet: stmmac: socfpga: add runtime suspend/resume callback for stratix10 platform (diff)
downloadlinux-6def480181f15f6d9ec812bca8cbc62451ba314c.tar.xz
linux-6def480181f15f6d9ec812bca8cbc62451ba314c.zip
net: return correct error code
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>
Diffstat (limited to 'net/ipv4/devinet.c')
-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 ec73a0d52d3e..323e622ff9b7 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -2591,7 +2591,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,