提交 ca746c55 编写于 作者: Z Zheng Yongjun 提交者: David S. Miller

net: Return the correct errno code

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: NZheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b923cda9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册