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.4.274~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71e40d389ba5c919b77c1e29738fbe5eae1c48bd;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 a9fd95d10e84a..156639be7ed00 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -550,7 +550,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;