summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2021-06-02 17:06:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-18 11:02:52 +0300
commitbc685cc0bbd2db158cbf4d13a8ee0af313ebe65a (patch)
tree90e5dc883b8f1dc86c8bad8ee6bd4f0f2f77015f
parent8478b361dfc567d5b9506749ccd24c225cf9b530 (diff)
downloadlinux-bc685cc0bbd2db158cbf4d13a8ee0af313ebe65a.tar.xz
net/x25: Return the correct errno code
[ Upstream commit d7736958668c4facc15f421e622ffd718f5be80a ] 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>
-rw-r--r--net/x25/af_x25.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index ff687b97b2d9..401901c8ad42 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -536,7 +536,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;