mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: qpic_common: fix BAM transaction memory leak
@ 2026-11-15  7:20 Felix Gu
  0 siblings, 0 replies; only message in thread
From: Felix Gu @ 2026-11-15  7:20 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Md Sadre Alam
  Cc: linux-mtd, linux-kernel, Sashiko, Felix Gu

qcom_nandc_alloc() allocates the BAM transaction, but
qcom_nandc_unalloc() does not free it. This leaks the transaction on
controller removal and probe failures after successful allocation.

Release it in qcom_nandc_unalloc().

Fixes: fdf3ee5c6e52 ("mtd: nand: Add qpic_common API file")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-ba3b41c6-9de2-42b9-8205-67454e0229f6
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/mtd/nand/qpic_common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/qpic_common.c b/drivers/mtd/nand/qpic_common.c
index e97043b866d2..0f81303ae8b6 100644
--- a/drivers/mtd/nand/qpic_common.c
+++ b/drivers/mtd/nand/qpic_common.c
@@ -657,6 +657,8 @@ void qcom_nandc_unalloc(struct qcom_nand_controller *nandc)
 
 		if (nandc->cmd_chan)
 			dma_release_channel(nandc->cmd_chan);
+
+		qcom_free_bam_transaction(nandc);
 	} else {
 		if (nandc->chan)
 			dma_release_channel(nandc->chan);

---
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
change-id: 20261115-nandc_unalloc-85129684cbad

Best regards,
--  
Felix Gu <ustc.gu@gmail.com>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-15  7:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-15  7:20 [PATCH] mtd: nand: qpic_common: fix BAM transaction memory leak Felix Gu

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®