Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3837890pxv; Mon, 28 Jun 2021 14:18:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy44/ZZbqGKNBpYFwC5/gjrh+XwA/Pxyms5yYz/+vEap+f65r0Z2yA0QvOrpNM5Vz/0b2lg X-Received: by 2002:a5d:9549:: with SMTP id a9mr1136540ios.152.1624915095627; Mon, 28 Jun 2021 14:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624915095; cv=none; d=google.com; s=arc-20160816; b=En1zUGN06OB4/pSeh4OL0JCxBscPnWmMpopHsFquW5aZ81fcDpixm6jsVAP/dX8Eas BGbP8y6Dfq5ExDBH1Ccald5voHMZyxsiJjC0vlfrj32ky9OLvR85s3//zLez8Z1hesCr H2CqHs8bWWfkf7McAeKlOtIXUeBgO1x3+NCc8vSkH6SdGGb/mnYxab61DiIaw9IdaBvD u9XTrIEyqGm4zK5BRh0EdQMnGghTWAjH16K8uJM8+3Hcz55CEBTSGfpKZ3tY1ef68YLP sYqrUY6oGgR7uT3Tvq6K8+bTR4IxyVevsn/238HURBaPfm2TPbrwxz5wMWnA9LAt25Yr amuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U4IXGOQtK5hD1WJQ2tzCyM2kB1ud1KAOJ8rphIDLurw=; b=cug4uid7u+G98b2doW+y2VeCYegXXcsfpZWbxZ2ThcxEYydnrs4FwFvB7BdEtoCxir UbE1mOPTFpQ8sc1xlp1JLjMgu46F21TpDq0gjmB2igHaj7ztIjf5uIt8B7HLfNtUaZwg RSOGcvGMmMIDkDQHrLiFR0T9um5JKGPtSW2EeHp9CvZBz0iuh3j05j5jbXp/YQXHKTGY 1D92Z1xiy5R35rSbYUrPzZCg67c6AhENM8WGNL/biDvixxwKu1m+U4Todth9oTEBRwDK o84Aa85XQFcssk68p2uk12DRrBo9M8iDTTBqV6Kh6xsUEjVpUVHfde06PXTMcZtk1Xxm iEfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uZkrhXNC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si21474497ilu.88.2021.06.28.14.17.59; Mon, 28 Jun 2021 14:18:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uZkrhXNC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236925AbhF1PSj (ORCPT + 99 others); Mon, 28 Jun 2021 11:18:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:59580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236958AbhF1O42 (ORCPT ); Mon, 28 Jun 2021 10:56:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 012D861C7B; Mon, 28 Jun 2021 14:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624891215; bh=ucLNLCf5rRm6SkudXfKKiS8NBTQNhJd1UmBUBzRPhyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uZkrhXNCy3Sl10D9tIjeRG5ErRARxBBxL9uxW2TG0XFcwZfAr5Fxdm3JO+YyK+fQ/ aNOmKe9GCyqKyC3VQiD31MHlzf91G0M5cx1dj94jg8zxo/DKQCoFRGvm43BdacOmpR FTXJD7i1DUwp84qGE6g+gUSLp4nqVll1i3LrZcQ5vb0sJgco9k0X2f0yl6SNPNYaJe w9g6M+wpGVviyz1SrEriquV6jNBVihaFvO60yp0gcN7GVV0W9Rv2IkZIwVz6vTsUAC gJWey0L/jtimo95CaUANXwYpr0IKhTRbLGrWmHFyDfImAtsc1QWhUtvs1whFhks04v reT60D5hYTeWQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zheng Yongjun , "David S . Miller" , Sasha Levin Subject: [PATCH 4.9 12/71] net/x25: Return the correct errno code Date: Mon, 28 Jun 2021 10:39:04 -0400 Message-Id: <20210628144003.34260-13-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628144003.34260-1-sashal@kernel.org> References: <20210628144003.34260-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.274-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.274-rc1 X-KernelTest-Deadline: 2021-06-30T14:39+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheng Yongjun [ 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 --- net/x25/af_x25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 9c3fbf4553cc..c23c04d38a82 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; -- 2.30.2