linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: alexandre.torgue@foss.st.com,cai.huoqing@linux.dev,christophe.kerello@foss.st.com,gregkh@linuxfoundation.org,jinpu.wang@ionos.com,linux-arm-kernel@lists.infradead.org,linux-mtd@lists.infradead.org,linux-stm32@st-md-mailman.stormreply.com,mcoquelin.stm32@gmail.com,miquel.raynal@bootlin.com,p.zabel@pengutronix.de,richard@nod.at,sashal@kernel.org,vigneshr@ti.com
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check" has been added to the 5.10-stable tree
Date: Sun, 14 Sep 2025 10:01:56 +0200	[thread overview]
Message-ID: <2025091456-rendering-twistable-9506@gregkh> (raw)
In-Reply-To: <20250913151912.1412912-1-sashal@kernel.org>


This is a note to let you know that I've just added the patch titled

    mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mtd-rawnand-stm32_fmc2-fix-dma_map_sg-error-check.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From stable+bounces-179501-greg=kroah.com@vger.kernel.org Sat Sep 13 17:19:24 2025
From: Sasha Levin <sashal@kernel.org>
Date: Sat, 13 Sep 2025 11:19:11 -0400
Subject: mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check
To: stable@vger.kernel.org
Cc: Jack Wang <jinpu.wang@ionos.com>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Philipp Zabel <p.zabel@pengutronix.de>, Christophe Kerello <christophe.kerello@foss.st.com>, Cai Huoqing <cai.huoqing@linux.dev>, linux-mtd@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sasha Levin <sashal@kernel.org>
Message-ID: <20250913151912.1412912-1-sashal@kernel.org>

From: Jack Wang <jinpu.wang@ionos.com>

[ Upstream commit 43b81c2a3e6e07915151045aa13a6e8a9bd64419 ]

dma_map_sg return 0 on error, in case of error return -EIO.

Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Christophe Kerello <christophe.kerello@foss.st.com>
Cc: Cai Huoqing <cai.huoqing@linux.dev>
Cc: linux-mtd@lists.infradead.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Reviewed-by: Christophe Kerello <christophe.kerello@foss.st.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220819060801.10443-5-jinpu.wang@ionos.com
Stable-dep-of: 513c40e59d5a ("mtd: rawnand: stm32_fmc2: avoid overlapping mappings on ECC buffer")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/mtd/nand/raw/stm32_fmc2_nand.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
+++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
@@ -858,8 +858,8 @@ static int stm32_fmc2_nfc_xfer(struct na
 
 	ret = dma_map_sg(nfc->dev, nfc->dma_data_sg.sgl,
 			 eccsteps, dma_data_dir);
-	if (ret < 0)
-		return ret;
+	if (!ret)
+		return -EIO;
 
 	desc_data = dmaengine_prep_slave_sg(dma_ch, nfc->dma_data_sg.sgl,
 					    eccsteps, dma_transfer_dir,
@@ -889,8 +889,10 @@ static int stm32_fmc2_nfc_xfer(struct na
 
 		ret = dma_map_sg(nfc->dev, nfc->dma_ecc_sg.sgl,
 				 eccsteps, dma_data_dir);
-		if (ret < 0)
+		if (!ret) {
+			ret = -EIO;
 			goto err_unmap_data;
+		}
 
 		desc_ecc = dmaengine_prep_slave_sg(nfc->dma_ecc_ch,
 						   nfc->dma_ecc_sg.sgl,


Patches currently in stable-queue which might be from sashal@kernel.org are

queue-5.10/media-i2c-imx214-fix-link-frequency-validation.patch
queue-5.10/flexfiles-pnfs-fix-null-checks-on-result-of-ff_layou.patch
queue-5.10/overflow-allow-mixed-type-arguments.patch
queue-5.10/tcp_bpf-call-sk_msg_free-when-tcp_bpf_send_verdict-f.patch
queue-5.10/media-mtk-vcodec-venc-avoid-wenum-compare-conditional-warning.patch
queue-5.10/tracing-fix-tracing_marker-may-trigger-page-fault-du.patch
queue-5.10/nfsv4-don-t-clear-capabilities-that-won-t-be-reset.patch
queue-5.10/s390-cpum_cf-deny-all-sampling-events-by-counter-pmu.patch
queue-5.10/mtd-add-check-for-devm_kcalloc.patch
queue-5.10/nfsv4-flexfiles-fix-layout-merge-mirror-check.patch
queue-5.10/overflow-correct-check_shl_overflow-comment.patch
queue-5.10/compiler.h-drop-fallback-overflow-checkers.patch
queue-5.10/mtd-nand-raw-atmel-respect-tar-tclr-in-read-setup-timing.patch
queue-5.10/mtd-nand-raw-atmel-fix-comment-in-timings-preparation.patch
queue-5.10/nfsv4-clear-the-nfs_cap_xattr-flag-if-not-supported-.patch
queue-5.10/net-fix-null-ptr-deref-by-sock_lock_init_class_and_name-and-rmmod.patch
queue-5.10/mtd-rawnand-stm32_fmc2-fix-dma_map_sg-error-check.patch
queue-5.10/mtd-rawnand-stm32_fmc2-avoid-overlapping-mappings-on-ecc-buffer.patch

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2025-09-14  8:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2025091309-quote-graves-e875@gregkh>
2025-09-13 15:19 ` [PATCH 5.10.y 1/2] mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check Sasha Levin
2025-09-14  8:01   ` gregkh [this message]

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=2025091456-rendering-twistable-9506@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=cai.huoqing@linux.dev \
    --cc=christophe.kerello@foss.st.com \
    --cc=jinpu.wang@ionos.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.zabel@pengutronix.de \
    --cc=richard@nod.at \
    --cc=sashal@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).