]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Jun 2021 22:13:56 +0000 (15:13 -0700)
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>
net/x25/af_x25.c

index 44d6566dd23e43f3c5de3c140037ccbb68e0cd38..1816899499ce89931da0904f227425cef4672964 100644 (file)
@@ -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;