]> www.infradead.org Git - users/dwmw2/linux.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:48:13 +0000 (08:48 -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 f43d037ea852042c497a6c655093f6c214012e54..f870027928363c4fc2ed222596272e310fa6487d 100644 (file)
@@ -551,7 +551,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;