Skip to contentSkip to conversation

mtd: nand: Fix dma_mapping_error() address

PATCH In review Thomas Fourier 2 participants 2 messages Jul 1, 2025

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

PATCH 1/1 mtd: nand: 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")
---
 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
maintainer
#1 lore raw

Hi Thomas,

Thanks for the patch!

On 01/07/2025 at 13:44:23 +02, Thomas Fourier <[email protected]> wrote:

The subject prefix should be 'mtd: rawnand: atmel:'

Quoted 5 lines

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")

Missing:

Quoted 2 lines

---

Otherwise looks good to me!

Thanks,
Miquèl