]> Gentwo Git Trees - linux/.git/commit
ASoC: codecs: va-macro: fix resource leak in probe error path
authorHaotian Zhang <vulab@iscas.ac.cn>
Thu, 6 Nov 2025 14:31:14 +0000 (22:31 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 6 Nov 2025 17:07:05 +0000 (17:07 +0000)
commit3dc8c73365d3ca25c99e7e1a0f493039d7291df5
tree17091c8007a4ff740edce0a0c0901e6a7ff6d3f1
parent84f5526e4dce0a44d050ceb1b1bf21d43016d91b
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: 30097967e056 ("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>
sound/soc/codecs/lpass-va-macro.c