From: Qasim Ijaz <qasdev00@gmail.com>
To: Sinan Kaya <okaya@kernel.org>, Vinod Koul <vkoul@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Qasim Ijaz <qasdev00@gmail.com>, stable@vger.kernel.org
Subject: [PATCH 2/2] dmaengine: qcom_hidma: fix handoff FIFO memory leak on driver removal
Date: Sun, 1 Jun 2025 23:42:31 +0100 [thread overview]
Message-ID: <20250601224231.24317-3-qasdev00@gmail.com> (raw)
In-Reply-To: <20250601224231.24317-1-qasdev00@gmail.com>
hidma_ll_init() allocates a handoff FIFO, but the matching
hidma_ll_uninit() function (which is invoked in remove())
never releases it, leaking memory.
To fix this call kfifo_free in hidma_ll_uninit().
Fixes: d1615ca2e085 ("dmaengine: qcom_hidma: implement lower level hardware interface")
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
---
drivers/dma/qcom/hidma_ll.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/qcom/hidma_ll.c b/drivers/dma/qcom/hidma_ll.c
index fee448499777..0c2bae46746c 100644
--- a/drivers/dma/qcom/hidma_ll.c
+++ b/drivers/dma/qcom/hidma_ll.c
@@ -816,6 +816,7 @@ int hidma_ll_uninit(struct hidma_lldev *lldev)
required_bytes = sizeof(struct hidma_tre) * lldev->nr_tres;
tasklet_kill(&lldev->task);
+ kfifo_free(&lldev->handoff_fifo);
memset(lldev->trepool, 0, required_bytes);
lldev->trepool = NULL;
atomic_set(&lldev->pending_tre_count, 0);
--
2.39.5
next prev parent reply other threads:[~2025-06-01 22:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-01 22:42 [PATCH 0/2] dmaengine: qcom_hidma: fix memory leak issues Qasim Ijaz
2025-06-01 22:42 ` [PATCH 1/2] dmaengine: qcom_hidma: fix memory leak on probe failure Qasim Ijaz
2025-06-05 13:06 ` Eugen Hristev
2025-06-01 22:42 ` Qasim Ijaz [this message]
2025-06-05 13:04 ` [PATCH 2/2] dmaengine: qcom_hidma: fix handoff FIFO memory leak on driver removal Eugen Hristev
2025-06-06 13:35 ` Sinan Kaya
2025-06-15 19:15 ` Qasim Ijaz
2025-06-16 21:59 ` Sinan Kaya
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=20250601224231.24317-3-qasdev00@gmail.com \
--to=qasdev00@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=okaya@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
/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 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.