mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init()
@ 2026-02-09  7:56 Chen Ni
  2026-02-25 10:30 ` ALOK TIWARI
  2026-02-25 16:49 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2026-02-09  7:56 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, niravkumarlaxmidas.rabara,
	alok.a.tiwari, piotrs
  Cc: linux-mtd, linux-kernel, Chen Ni

Fix wrong variable used for error checking after dma_alloc_coherent()
call. The function checks cdns_ctrl->dma_cdma_desc instead of
cdns_ctrl->cdma_desc, which could lead to incorrect error handling.

Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/mtd/nand/raw/cadence-nand-controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/nand/raw/cadence-nand-controller.c
index 99135ec23010..d53b35a8b3cb 100644
--- a/drivers/mtd/nand/raw/cadence-nand-controller.c
+++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
@@ -3133,7 +3133,7 @@ static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl)
 						  sizeof(*cdns_ctrl->cdma_desc),
 						  &cdns_ctrl->dma_cdma_desc,
 						  GFP_KERNEL);
-	if (!cdns_ctrl->dma_cdma_desc)
+	if (!cdns_ctrl->cdma_desc)
 		return -ENOMEM;
 
 	cdns_ctrl->buf_size = SZ_16K;
-- 
2.25.1


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

* Re: [PATCH] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init()
  2026-02-09  7:56 [PATCH] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init() Chen Ni
@ 2026-02-25 10:30 ` ALOK TIWARI
  2026-02-25 16:49 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: ALOK TIWARI @ 2026-02-25 10:30 UTC (permalink / raw)
  To: Chen Ni, miquel.raynal, richard, vigneshr,
	niravkumarlaxmidas.rabara, piotrs
  Cc: linux-mtd, linux-kernel



On 2/9/2026 1:26 PM, Chen Ni wrote:
> Fix wrong variable used for error checking after dma_alloc_coherent()
> call. The function checks cdns_ctrl->dma_cdma_desc instead of
> cdns_ctrl->cdma_desc, which could lead to incorrect error handling.
> 
> Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
> Signed-off-by: Chen Ni<nichen@iscas.ac.cn>
> ---
>   drivers/mtd/nand/raw/cadence-nand-controller.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/nand/raw/cadence-nand-controller.c
> index 99135ec23010..d53b35a8b3cb 100644
> --- a/drivers/mtd/nand/raw/cadence-nand-controller.c
> +++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
> @@ -3133,7 +3133,7 @@ static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl)
>   						  sizeof(*cdns_ctrl->cdma_desc),
>   						  &cdns_ctrl->dma_cdma_desc,
>   						  GFP_KERNEL);
> -	if (!cdns_ctrl->dma_cdma_desc)
> +	if (!cdns_ctrl->cdma_desc)
>   		return -ENOMEM;

LGTM,

Reviewed-by: Alok Tiwari <alok.a.tiwari@oracle.com>

Thanks,
Alok

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

* Re: [PATCH] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init()
  2026-02-09  7:56 [PATCH] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init() Chen Ni
  2026-02-25 10:30 ` ALOK TIWARI
@ 2026-02-25 16:49 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2026-02-25 16:49 UTC (permalink / raw)
  To: richard, vigneshr, niravkumarlaxmidas.rabara, alok.a.tiwari,
	piotrs, Chen Ni
  Cc: linux-mtd, linux-kernel

On Mon, 09 Feb 2026 15:56:18 +0800, Chen Ni wrote:
> Fix wrong variable used for error checking after dma_alloc_coherent()
> call. The function checks cdns_ctrl->dma_cdma_desc instead of
> cdns_ctrl->cdma_desc, which could lead to incorrect error handling.
> 
> 

Applied to mtd/fixes, thanks!

[1/1] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init()
      commit: 0410e1a4c545c769c59c6eda897ad5d574d0c865

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


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

end of thread, other threads:[~2026-02-25 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-09  7:56 [PATCH] mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init() Chen Ni
2026-02-25 10:30 ` ALOK TIWARI
2026-02-25 16:49 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®