* [PATCH] soundoc: qcom: va-macro: fix resource leak in va_macro_remove()
@ 2025-11-03 3:47 Haotian Zhang
0 siblings, 0 replies; only message in thread
From: Haotian Zhang @ 2025-11-03 3:47 UTC (permalink / raw)
To: srini, broonie
Cc: lgirdwood, jaroslav.kysela, tiwai, linux-sound, linux-arm-msm,
linux-kernel, Haotian Zhang
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-03 3:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-03 3:47 [PATCH] soundoc: qcom: va-macro: fix resource leak in va_macro_remove() Haotian Zhang
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®