Skip to contentSkip to conversation

soundoc: qcom: va-macro: fix resource leak in va_macro_remove()

PATCH New Haotian Zhang 1 participant 1 message Nov 3, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soundoc: qcom: va-macro: fix resource leak in va_macro_remove()

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")
---
 sound/soc/codecs/lpass-va-macro.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/lpass-va-macro.c +1 -0
index a49551f3fb29..440d0f54aa33 100644
@@ -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);
 
Signature · 1 line
2.50.1.windows.1