Skip to content

Commit

Permalink
net/x25: Return the correct errno code
Browse files Browse the repository at this point in the history
[ Upstream commit d773695 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zheng Yongjun authored and gregkh committed Jun 18, 2021
1 parent 0aa3569 commit 04c1556
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/x25/af_x25.c
Expand Up @@ -546,7 +546,7 @@ static int x25_create(struct net *net, struct socket *sock, int protocol,
if (protocol)
goto out;

rc = -ENOBUFS;
rc = -ENOMEM;
if ((sk = x25_alloc_socket(net, kern)) == NULL)
goto out;

Expand Down

0 comments on commit 04c1556

Please sign in to comment.