From: Zheng Yongjun Date: Wed, 2 Jun 2021 14:06:30 +0000 (+0800) Subject: net/x25: Return the correct errno code X-Git-Tag: v4.19.196~91 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1f61f0ee4a94c73e505b38f0ff045a0e7e19fa61;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index f43d037ea8520..f870027928363 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -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;