Skip to contentSkip to conversation

mtd: rawnand: atmel: Fix dma_mapping_error() address

PATCH Applied Thomas Fourier 4 participants 4 messages Jul 2, 2025 – Jul 28, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mtd: rawnand: atmel: Fix dma_mapping_error() address

It seems like what was intended is to test if the dma_map of the previous line failed but the wrong dma address was passed.

Fixes f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")

---
v1 -> v2:
- Add [email protected]
- Fix subject prefix

 drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -1
index dedcca87defc..84ab4a83cbd6 100644
@@ -373,7 +373,7 @@ static int atmel_nand_dma_transfer(struct atmel_nand_controller *nc,
 	dma_cookie_t cookie;
 
 	buf_dma = dma_map_single(nc->dev, buf, len, dir);
-	if (dma_mapping_error(nc->dev, dev_dma)) {
+	if (dma_mapping_error(nc->dev, buf_dma)) {
 		dev_err(nc->dev,
 			"Failed to prepare a buffer for DMA access\n");
 		goto err;
Signature · 1 line
2.43.0
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v2] mtd: rawnand: atmel: Fix dma_mapping_error() address

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#2 lore raw
In reply to Thomas Fourier

Reviewed-by: Balamanikandan Gunasundar
<[email protected]>

Quoted 35 lines · Thomas Fourier

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

It seems like what was intended is to test if the dma_map of the previous line failed but the wrong dma address was passed.

Fixes f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")

---
v1 -> v2:
- Add [email protected]
- Fix subject prefix

  drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -2
index dedcca87defc..84ab4a83cbd6 100644
@@ -373,7 +373,7 @@ static int atmel_nand_dma_transfer(struct atmel_nand_controller *nc,
         dma_cookie_t cookie;
 
         buf_dma = dma_map_single(nc->dev, buf, len, dir);
-       if (dma_mapping_error(nc->dev, dev_dma)) {
+       if (dma_mapping_error(nc->dev, buf_dma)) {
                 dev_err(nc->dev,
                         "Failed to prepare a buffer for DMA access\n");
                 goto err;
--

2.43.0

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

maintainer Applied
#3 lore raw
In reply to Thomas Fourier
Quoted 4 lines · Thomas Fourier

It seems like what was intended is to test if the dma_map of the previous line failed but the wrong dma address was passed.

Applied to nand/next, thanks!

[1/1] mtd: rawnand: atmel: Fix dma_mapping_error() address

      commit: 9e2e2576bc49c3bc352d402963f7ba8774c3d95f

Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl