Re: [PATCH v4 3/4] ASoC: Intel: cht_bsw_rt5672: Fix MCLK leak in platform_clock_control

From: Cezary Rojewski

Date: Mon Mar 30 2026 - 04:41:32 EST


On 2026-03-30 10:33 AM, Cezary Rojewski wrote:
On 2026-03-28 6:25 AM, aravindanilraj0702@xxxxxxxxx wrote:
From: Aravind Anilraj <aravindanilraj0702@xxxxxxxxx>

If snd_soc_dai_set_pll() or snd_soc_dai_set_sysclk() fail inside the
EVENT_ON path, the function returns without calling
clk_disable_unprepare() on ctx->mclk, which was already enabled earlier
in the same code path. Add the missing clk_disable_unprepare() calls
before returning the error.

Signed-off-by: Aravind Anilraj <aravindanilraj0702@xxxxxxxxx>

Thank you for the fix.

Reviewed-by: Cezary Rojewski <cezary.rojewski@xxxxxxxxx>

---
  sound/soc/intel/boards/cht_bsw_rt5672.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/ intel/boards/cht_bsw_rt5672.c
index 359723f2700e..e5806dc16ff9 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -67,7 +67,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
              ret = clk_prepare_enable(ctx->mclk);
              if (ret < 0) {
                  dev_err(card->dev,
-                    "could not configure MCLK state");
+                    "could not configure MCLK state\n");


I've overlooked the string changes. For all three leading patches, please ensure only clk_disable_unprepare() is part of them. The updates to the dev_err() make the patches non-atomic and you already have a dedicated patch for dev_err() - the fourth patch. Do those changes there.

                  return ret;
              }
          }