From: Haotian Zhang <vulab@iscas.ac.cn>
To: srini@kernel.org, broonie@kernel.org
Cc: lgirdwood@gmail.com, jaroslav.kysela@perex.cz, tiwai@suse.com,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, Haotian Zhang <vulab@iscas.ac.cn>
Subject: [PATCH] soundoc: qcom: va-macro: fix resource leak in va_macro_remove()
Date: Mon, 3 Nov 2025 11:47:35 +0800 [thread overview]
Message-ID: <20251103034735.90-1-vulab@iscas.ac.cn> (raw)
The va_macro_probe() function calls clk_hw_get_clk() to obtain the
fsgen clock, which increments the clock's reference count. However,
the corresponding va_macro_remove() function does not call clk_put()
to release this reference, resulting in a resource leak.
Add clk_put() call in va_macro_remove() to properly release the fsgen
clock reference.
Fixes: 908e6b1df26e ("ASoC: codecs: lpass-va-macro: Add support to VA Macro")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
sound/soc/codecs/lpass-va-macro.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index a49551f3fb29..440d0f54aa33 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -1663,6 +1663,7 @@ static void va_macro_remove(struct platform_device *pdev)
{
struct va_macro *va = dev_get_drvdata(&pdev->dev);
+ clk_put(va->fsgen);
if (va->has_npl_clk)
clk_disable_unprepare(va->npl);
--
2.50.1.windows.1
reply other threads:[~2025-11-03 3:48 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=20251103034735.90-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=broonie@kernel.org \
--cc=jaroslav.kysela@perex.cz \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=srini@kernel.org \
--cc=tiwai@suse.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®