All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mtd: rawnand: atmel: Add missing check after DMA map
@ 2025-07-02  6:58 ` Thomas Fourier
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Fourier @ 2025-07-02  6:58 UTC (permalink / raw)
  Cc: Thomas Fourier, stable, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Uwe Kleine-König, Vipin Kumar,
	Artem Bityutskiy, Viresh Kumar, David Woodhouse, linux-mtd,
	linux-kernel

The DMA map functions can fail and should be tested for errors.

Fixes: 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
v1 -> v2:
- Add stable@vger.kernel.org
- Fix subject prefix
 
 drivers/mtd/nand/raw/fsmc_nand.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index d579d5dd60d6..df61db8ce466 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -503,6 +503,8 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
 
 	dma_dev = chan->device;
 	dma_addr = dma_map_single(dma_dev->dev, buffer, len, direction);
+	if (dma_mapping_error(dma_dev->dev, dma_addr))
+		return -EINVAL;
 
 	if (direction == DMA_TO_DEVICE) {
 		dma_src = dma_addr;
-- 
2.43.0


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

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

* [PATCH v2] mtd: rawnand: atmel: Add missing check after DMA map
@ 2025-07-02  6:58 ` Thomas Fourier
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Fourier @ 2025-07-02  6:58 UTC (permalink / raw)
  Cc: Thomas Fourier, stable, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Uwe Kleine-König, Vipin Kumar,
	Artem Bityutskiy, Viresh Kumar, David Woodhouse, linux-mtd,
	linux-kernel

The DMA map functions can fail and should be tested for errors.

Fixes: 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
v1 -> v2:
- Add stable@vger.kernel.org
- Fix subject prefix
 
 drivers/mtd/nand/raw/fsmc_nand.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index d579d5dd60d6..df61db8ce466 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -503,6 +503,8 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
 
 	dma_dev = chan->device;
 	dma_addr = dma_map_single(dma_dev->dev, buffer, len, direction);
+	if (dma_mapping_error(dma_dev->dev, dma_addr))
+		return -EINVAL;
 
 	if (direction == DMA_TO_DEVICE) {
 		dma_src = dma_addr;
-- 
2.43.0


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

* Re: [PATCH v2] mtd: rawnand: atmel: Add missing check after DMA map
  2025-07-02  6:58 ` Thomas Fourier
  (?)
@ 2025-07-02  7:00 ` kernel test robot
  -1 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-07-02  7:00 UTC (permalink / raw)
  To: Thomas Fourier; +Cc: stable, oe-kbuild-all

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: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v2] mtd: rawnand: atmel: Add missing check after DMA map
Link: https://lore.kernel.org/stable/20250702065806.20983-2-fourier.thomas%40gmail.com

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




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

* Re: [PATCH v2] mtd: rawnand: atmel: Add missing check after DMA map
  2025-07-02  6:58 ` Thomas Fourier
  (?)
  (?)
@ 2025-07-02 10:48 ` Balamanikandan.Gunasundar
  -1 siblings, 0 replies; 4+ messages in thread
From: Balamanikandan.Gunasundar @ 2025-07-02 10:48 UTC (permalink / raw)
  To: fourier.thomas
  Cc: stable, miquel.raynal, richard, vigneshr, u.kleine-koenig,
	vipin.kumar, artem.bityutskiy, vireshk, David.Woodhouse,
	linux-mtd, linux-kernel, Balamanikandan.Gunasundar

Wrong subject prefix ?

On 02/07/25 12:28 pm, Thomas Fourier wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> The DMA map functions can fail and should be tested for errors.
> 
> Fixes: 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")
> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
> ---
> v1 -> v2:
> - Add stable@vger.kernel.org
> - Fix subject prefix
> 
>   drivers/mtd/nand/raw/fsmc_nand.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
> index d579d5dd60d6..df61db8ce466 100644
> --- a/drivers/mtd/nand/raw/fsmc_nand.c
> +++ b/drivers/mtd/nand/raw/fsmc_nand.c
> @@ -503,6 +503,8 @@ static int dma_xfer(struct fsmc_nand_data *host, void *buffer, int len,
> 
>          dma_dev = chan->device;
>          dma_addr = dma_map_single(dma_dev->dev, buffer, len, direction);
> +       if (dma_mapping_error(dma_dev->dev, dma_addr))
> +               return -EINVAL;
> 
>          if (direction == DMA_TO_DEVICE) {
>                  dma_src = dma_addr;
> --
> 2.43.0
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


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

end of thread, other threads:[~2025-07-02 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  6:58 [PATCH v2] mtd: rawnand: atmel: Add missing check after DMA map Thomas Fourier
2025-07-02  6:58 ` Thomas Fourier
2025-07-02  7:00 ` kernel test robot
2025-07-02 10:48 ` Balamanikandan.Gunasundar

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.