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>
This commit is contained in:
liuguoqiang 2021-11-15 16:14:48 +08:00 committed by David S. Miller
parent 9119570039
commit 6def480181

View File

@ -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,