linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: Fix dma_mapping_error() address
@ 2025-07-01 11:44 Thomas Fourier
  2025-07-01 12:51 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Fourier @ 2025-07-01 11:44 UTC (permalink / raw)
  Cc: Thomas Fourier, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea, Uwe Kleine-König, Alexander Dahl,
	Boris Brezillon, linux-mtd, linux-arm-kernel, linux-kernel

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")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index dedcca87defc..84ab4a83cbd6 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: nand: Fix dma_mapping_error() address
  2025-07-01 11:44 [PATCH] mtd: nand: Fix dma_mapping_error() address Thomas Fourier
@ 2025-07-01 12:51 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2025-07-01 12:51 UTC (permalink / raw)
  To: Thomas Fourier
  Cc: Richard Weinberger, Vignesh Raghavendra, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Uwe Kleine-König,
	Alexander Dahl, Boris Brezillon, linux-mtd, linux-arm-kernel,
	linux-kernel

Hi Thomas,

Thanks for the patch!

On 01/07/2025 at 13:44:23 +02, Thomas Fourier <fourier.thomas@gmail.com> wrote:

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

> 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:

Cc: stable@vger.kernel.org

> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
> ---

Otherwise looks good to me!

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-01 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 11:44 [PATCH] mtd: nand: Fix dma_mapping_error() address Thomas Fourier
2025-07-01 12:51 ` Miquel Raynal

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