Skip to content

Commit

Permalink
net: return correct error code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
liuguoqiang authored and David S. Miller committed Nov 15, 2021
1 parent 9119570 commit 6def480
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6def480

Please sign in to comment.