summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2021-06-02 22:06:30 +0800
committerSasha Levin <sashal@kernel.org>2021-06-30 08:49:31 -0400
commit71e40d389ba5c919b77c1e29738fbe5eae1c48bd (patch)
treef7c7c1ab7c7290e6b8572e1704ab13703d1f6195 /net
parenta0183e20884167857ca3325c90f4ec37e907c788 (diff)
downloadlinux-stable-71e40d389ba5c919b77c1e29738fbe5eae1c48bd.tar.gz
linux-stable-71e40d389ba5c919b77c1e29738fbe5eae1c48bd.tar.bz2
linux-stable-71e40d389ba5c919b77c1e29738fbe5eae1c48bd.zip
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>
Diffstat (limited to 'net')
-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 a9fd95d10e84..156639be7ed0 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -550,7 +550,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;