Skip to content

Commit 4e550b5

Browse files
CassivsGabriellisgregkh
authored andcommitted
ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error
commit 13d3068 upstream. 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. Fixes: 9a87fc1 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Link: https://patch.msgid.link/20260427-bytcr-wm5102-mclk-leak-v1-1-02b96d08e99c@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 846fcce commit 4e550b5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sound/soc/intel/boards/bytcr_wm5102.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
171171
ret = byt_wm5102_prepare_and_enable_pll1(codec_dai, 48000);
172172
if (ret) {
173173
dev_err(card->dev, "Error setting codec sysclk: %d\n", ret);
174+
clk_disable_unprepare(priv->mclk);
174175
return ret;
175176
}
176177
} else {

0 commit comments

Comments
 (0)