diff options
author | Peter Ujfalusi <peter.ujfalusi@gmail.com> | 2021-07-17 14:28:18 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-07-19 13:58:41 +0200 |
commit | 78d2a05ef22e7b5863b01e073dd6a06b3979bb00 (patch) | |
tree | 15663f79a3b06b8d0b0ff86ac2d92e931b932a24 /sound/soc/ti/j721e-evm.c | |
parent | ASoC: rt5682: Fix the issue of garbled recording after powerd_dbus_suspend (diff) | |
download | linux-78d2a05ef22e7b5863b01e073dd6a06b3979bb00.tar.xz linux-78d2a05ef22e7b5863b01e073dd6a06b3979bb00.zip |
ASoC: ti: j721e-evm: Fix unbalanced domain activity tracking during startup
In case of an error within j721e_audio_startup() the domain->active must
be decremented to avoid unbalanced counter.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210717122820.1467-2-peter.ujfalusi@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/ti/j721e-evm.c')
-rw-r--r-- | sound/soc/ti/j721e-evm.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/ti/j721e-evm.c b/sound/soc/ti/j721e-evm.c index a7c0484d44ec..017c4ad11ca6 100644 --- a/sound/soc/ti/j721e-evm.c +++ b/sound/soc/ti/j721e-evm.c @@ -278,23 +278,29 @@ static int j721e_audio_startup(struct snd_pcm_substream *substream) j721e_rule_rate, &priv->rate_range, SNDRV_PCM_HW_PARAM_RATE, -1); - mutex_unlock(&priv->mutex); if (ret) - return ret; + goto out; /* Reset TDM slots to 32 */ ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 32); if (ret && ret != -ENOTSUPP) - return ret; + goto out; for_each_rtd_codec_dais(rtd, i, codec_dai) { ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 2, 32); if (ret && ret != -ENOTSUPP) - return ret; + goto out; } - return 0; + if (ret == -ENOTSUPP) + ret = 0; +out: + if (ret) + domain->active--; + mutex_unlock(&priv->mutex); + + return ret; } static int j721e_audio_hw_params(struct snd_pcm_substream *substream, |