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.10.45~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04c1556bfc79734ae91af632aff2f754a501c36c;p=thirdparty%2Fkernel%2Fstable.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 e65a50192432c..03ed170b8125e 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;