]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/x25: Return the correct errno code
authorZheng Yongjun <zhengyongjun3@huawei.com>
Wed, 2 Jun 2021 14:06:30 +0000 (22:06 +0800)
committerSasha Levin <sashal@kernel.org>
Wed, 30 Jun 2021 12:49:31 +0000 (08:49 -0400)
[ 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>
net/x25/af_x25.c

index a9fd95d10e84a3d677d4481786d032a1a8835112..156639be7ed00355a311caed5d6a304c66ba6c33 100644 (file)
@@ -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;