Re: [PATCH] ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error

From: Andy Shevchenko

Date: Tue Apr 28 2026 - 02:59:26 EST


On Tue, Apr 28, 2026 at 5:38 AM Cássio Gabriel
<cassiogabrielcontato@xxxxxxxxx> wrote:
>
> If byt_wm5102_prepare_and_enable_pll1() fails in the
> SND_SOC_DAPM_EVENT_ON() path, platform_clock_control() returns after
> clk_prepare_enable(priv->mclk) without disabling the clock again.
>
> This leaks an MCLK enable reference on failed power-up attempts. Add the
> missing clk_disable_unprepare() on the error path, matching the unwind
> used by the other Intel platform_clock_control() implementations.

There are 6 drivers that do the same, why is only this one special?
Have you checked the flow on the error path of the caller of this
`platform_clock_control()`? Maybe there it calls with the opposite
event to shut the clock down?

...

TL;DR: If it's a real issue, it has to be fixed for all affected drivers.


--
With Best Regards,
Andy Shevchenko