ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable
Subsystems (4)
PATCH 1/1 ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable
swclk_gate_enable() calls pm_runtime_resume_and_get() (incrementing the PM usage counter and, via of_pm_clk_add_clks, enabling mclk) before rx_macro_mclk_enable(). On rx_macro_mclk_enable() failure it called clk_disable_unprepare(rx->mclk) and returned, leaking the PM usage counter and potentially unbalancing the clock that the PM clock domain also manages. The sibling tx-macro/va-macro drivers call pm_runtime_put_autosuspend() here; do the same.
--- sound/soc/codecs/lpass-rx-macro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/lpass-rx-macro.c +1 -1
@@ -3681,7 +3681,7 @@ static int swclk_gate_enable(struct clk_hw *hw) ret =rx_macro_mclk_enable (rx, true);if (ret) { -clk_disable_unprepare (rx->mclk); +pm_runtime_put_autosuspend (rx->dev);return ret; }
Signature · 1 line
2.52.0.windows.1
Quoted 10 lines · Tang Bin
swclk_gate_enable()callspm_runtime_resume_and_get()(incrementing the PM usage counter and, viaof_pm_clk_add_clks, enabling mclk) beforerx_macro_mclk_enable(). Onrx_macro_mclk_enable()failure it calledclk_disable_unprepare(rx->mclk)and returned, leaking the PM usage counter and potentially unbalancing the clock that the PM clock domain also manages. The sibling tx-macro/va-macro drivers callpm_runtime_put_autosuspend()here; do the same.Fixes e38cbb75248a ("ASoC: codecs: lpass-rx-macro: Propagate regcache_sync() errors")Signed-off-by Tang Bin <[email protected]>
LGTM,
Thanks,
Prasad
Mark Brown
maintainerQuoted 1 line · Tang Bin
ASoC: codecs: lpass-rx-macro: fix PM ref leak in
swclk_gate_enable
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable
https://git.kernel.org/broonie/sound/c/e2df0223ba6d
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark