All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Zheng Yongjun <zhengyongjun3@huawei.com>,
	"David S. Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.4 27/28] net: Return the correct errno code
Date: Wed, 16 Jun 2021 17:33:38 +0200	[thread overview]
Message-ID: <20210616152835.009713792@linuxfoundation.org> (raw)
In-Reply-To: <20210616152834.149064097@linuxfoundation.org>

From: Zheng Yongjun <zhengyongjun3@huawei.com>

[ Upstream commit 49251cd00228a3c983651f6bb2f33f6a0b8f152e ]

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/compat.c b/net/compat.c
index c848bcb517f3..f5b88166c44a 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -160,7 +160,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
 	if (kcmlen > stackbuf_size)
 		kcmsg_base = kcmsg = sock_kmalloc(sk, kcmlen, GFP_KERNEL);
 	if (kcmsg == NULL)
-		return -ENOBUFS;
+		return -ENOMEM;
 
 	/* Now copy them over neatly. */
 	memset(kcmsg, 0, kcmlen);
-- 
2.30.2




  parent reply	other threads:[~2021-06-16 15:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 15:33 [PATCH 5.4 00/28] 5.4.127-rc1 review Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 01/28] net: ieee802154: fix null deref in parse dev addr Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 02/28] HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for Saitek X65 Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 03/28] HID: hid-input: add mapping for emoji picker key Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 04/28] HID: hid-sensor-hub: Return error for hid_set_field() failure Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 05/28] HID: quirks: Add quirk for Lenovo optical mouse Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 06/28] HID: multitouch: set Stylus suffix for Stylus-application devices, too Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 07/28] HID: Add BUS_VIRTUAL to hid_connect logging Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 08/28] HID: usbhid: fix info leak in hid_submit_ctrl Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 09/28] drm/tegra: sor: Do not leak runtime PM reference Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 10/28] ARM: OMAP2+: Fix build warning when mmc_omap is not built Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 11/28] gfs2: Prevent direct-I/O write fallback errors from getting lost Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 12/28] HID: gt683r: add missing MODULE_DEVICE_TABLE Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 13/28] riscv: Use -mno-relax when using lld linker Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 14/28] gfs2: Fix use-after-free in gfs2_glock_shrink_scan Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 15/28] scsi: target: core: Fix warning on realtime kernels Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 16/28] ethernet: myri10ge: Fix missing error code in myri10ge_probe() Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 17/28] scsi: qedf: Do not put host in qedf_vport_create() unconditionally Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 18/28] scsi: scsi_devinfo: Add blacklist entry for HPE OPEN-V Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 19/28] nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues() Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 20/28] nvme-loop: clear NVME_LOOP_Q_LIVE when nvme_loop_configure_admin_queue() fails Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 21/28] nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue() Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 22/28] net: ipconfig: Dont override command-line hostnames or domains Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 23/28] drm/amd/display: Allow bandwidth validation for 0 streams Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 24/28] drm/amd/display: Fix overlay validation by considering cursors Greg Kroah-Hartman
2021-06-16 15:59   ` Harry Wentland
2021-06-16 16:25     ` Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 25/28] rtnetlink: Fix missing error code in rtnl_bridge_notify() Greg Kroah-Hartman
2021-06-16 15:33 ` [PATCH 5.4 26/28] net/x25: Return the correct errno code Greg Kroah-Hartman
2021-06-16 15:33 ` Greg Kroah-Hartman [this message]
2021-06-16 15:33 ` [PATCH 5.4 28/28] fib: " Greg Kroah-Hartman
2021-06-16 18:49 ` [PATCH 5.4 00/28] 5.4.127-rc1 review Jon Hunter
2021-06-16 22:37 ` Florian Fainelli
2021-06-17 10:42 ` Naresh Kamboju
2021-06-17 10:59 ` Sudip Mukherjee
2021-06-17 21:39 ` Guenter Roeck
2021-06-18  0:35 ` Samuel Zou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210616152835.009713792@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zhengyongjun3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.