mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
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: 30097967e0 ("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>
This commit is contained in:
parent
84f5526e4d
commit
3dc8c73365
|
|
@ -1638,7 +1638,7 @@ static int va_macro_probe(struct platform_device *pdev)
|
|||
if (ret)
|
||||
goto err_clkout;
|
||||
|
||||
va->fsgen = clk_hw_get_clk(&va->hw, "fsgen");
|
||||
va->fsgen = devm_clk_hw_get_clk(dev, &va->hw, "fsgen");
|
||||
if (IS_ERR(va->fsgen)) {
|
||||
ret = PTR_ERR(va->fsgen);
|
||||
goto err_clkout;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user