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

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®