mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felix Gu <ustc.gu@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	 Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	 Md Sadre Alam <quic_mdalam@quicinc.com>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	 Sashiko <sashiko-bot@kernel.org>, Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] mtd: nand: qpic_common: fix BAM transaction memory leak
Date: Sun, 15 Nov 2026 15:20:01 +0800	[thread overview]
Message-ID: <20261115-nandc_unalloc-v1-1-65d849fa9998@gmail.com> (raw)

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>


                 reply	other threads:[~2026-11-15  7:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261115-nandc_unalloc-v1-1-65d849fa9998@gmail.com \
    --to=ustc.gu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=quic_mdalam@quicinc.com \
    --cc=richard@nod.at \
    --cc=sashiko-bot@kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®