mirror of https://gitee.com/openkylin/linux.git
net: Return the correct errno code
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b923cda963
commit
ca746c55a7
|
@ -318,7 +318,7 @@ static int inet_create(struct net *net, struct socket *sock, int protocol,
|
|||
|
||||
WARN_ON(!answer_prot->slab);
|
||||
|
||||
err = -ENOBUFS;
|
||||
err = -ENOMEM;
|
||||
sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, kern);
|
||||
if (!sk)
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue