From: Zheng Yongjun Date: Wed, 2 Jun 2021 14:06:30 +0000 (+0800) Subject: net/x25: Return the correct errno code X-Git-Tag: v5.4.127~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=376a703f9dce51cf46e2d395fb0c86b4476fb666;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 cb1f5016c433a..d8d603aa48875 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -546,7 +546,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;