History

ASoC: Intel: cht_bsw_rt5672: Fix MCLK leak on platform_clock_control error

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.

Aravind Anilraj committed 7 months ago

Commit dced5a31 parent b022e5c1 file · +4 −0Browse files

Unified · Split

sound/soc/intel/boards/cht_bsw_rt5672.c+4−0
@@ -77,6 +77,8 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, · 76 unmodified lines
77 CHT_PLAT_CLK_3_HZ, 48000 * 512);77 CHT_PLAT_CLK_3_HZ, 48000 * 512);
78 if (ret < 0) {78 if (ret < 0) {
79 dev_err(card->dev, "can't set codec pll: %d\n", ret);79 dev_err(card->dev, "can't set codec pll: %d\n", ret);
80 if (ctx->mclk)
81 clk_disable_unprepare(ctx->mclk);
80 return ret;82 return ret;
81 }83 }
82 84
@@ -85,6 +87,8 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, · 2 unmodified lines
85 48000 * 512, SND_SOC_CLOCK_IN);87 48000 * 512, SND_SOC_CLOCK_IN);
86 if (ret < 0) {88 if (ret < 0) {
87 dev_err(card->dev, "can't set codec sysclk: %d\n", ret);89 dev_err(card->dev, "can't set codec sysclk: %d\n", ret);
90 if (ctx->mclk)
91 clk_disable_unprepare(ctx->mclk);
88 return ret;92 return ret;
89 }93 }
90 } else {94 } else {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t