[PATCH] ASoC: cs42l43: leak MCLK when PLL enable fails on PRE_PMU
From: Tang Bin
Date: Wed Nov 04 2026 - 03:03:45 EST
cs42l43_pll_ev() PRE_PMU arm enables mclk (when refclk_src is MCLK) then
calls cs42l43_enable_pll(). If PLL enable fails, ret is negative and DAPM
does not power up the widget, so POST_PMD never runs and the matching
clk_disable_unprepare(mclk) at line 1621 is skipped - mclk refcount leaked.
Roll back the mclk enable on PLL failure.
Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx>
---
sound/soc/codecs/cs42l43.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c
index 1b817e1a6..0ac9e2361 100644
--- a/sound/soc/codecs/cs42l43.c
+++ b/sound/soc/codecs/cs42l43.c
@@ -1613,6 +1613,8 @@ static int cs42l43_pll_ev(struct snd_soc_dapm_widget *w,
}
ret = cs42l43_enable_pll(priv);
+ if (ret && priv->refclk_src == CS42L43_SYSCLK_MCLK)
+ clk_disable_unprepare(priv->mclk);
break;
case SND_SOC_DAPM_POST_PMD:
ret = cs42l43_disable_pll(priv);
--
2.52.0.windows.1