Skip to content

Commit 3dc8c73

Browse files
ISCAS-Vulabbroonie
authored andcommitted
ASoC: codecs: va-macro: fix resource leak in probe error path
In the commit referenced by the Fixes tag, clk_hw_get_clk() was added in va_macro_probe() to get the fsgen clock, but forgot to add the corresponding clk_put() in va_macro_remove(). This leads to a clock reference leak when the driver is unloaded. Switch to devm_clk_hw_get_clk() to automatically manage the clock resource. Fixes: 3009796 ("ASoC: codecs: va-macro: use fsgen as clock") Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20251106143114.729-1-vulab@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 84f5526 commit 3dc8c73

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/codecs/lpass-va-macro.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ static int va_macro_probe(struct platform_device *pdev)
16381638
if (ret)
16391639
goto err_clkout;
16401640

1641-
va->fsgen = clk_hw_get_clk(&va->hw, "fsgen");
1641+
va->fsgen = devm_clk_hw_get_clk(dev, &va->hw, "fsgen");
16421642
if (IS_ERR(va->fsgen)) {
16431643
ret = PTR_ERR(va->fsgen);
16441644
goto err_clkout;

0 commit comments

Comments
 (0)