Skip to content

Commit 78d2a05

Browse files
ujfalusibroonie
authored andcommitted
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>
1 parent 6a503e1 commit 78d2a05

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

sound/soc/ti/j721e-evm.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,23 +278,29 @@ static int j721e_audio_startup(struct snd_pcm_substream *substream)
278278
j721e_rule_rate, &priv->rate_range,
279279
SNDRV_PCM_HW_PARAM_RATE, -1);
280280

281-
mutex_unlock(&priv->mutex);
282281

283282
if (ret)
284-
return ret;
283+
goto out;
285284

286285
/* Reset TDM slots to 32 */
287286
ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 32);
288287
if (ret && ret != -ENOTSUPP)
289-
return ret;
288+
goto out;
290289

291290
for_each_rtd_codec_dais(rtd, i, codec_dai) {
292291
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 2, 32);
293292
if (ret && ret != -ENOTSUPP)
294-
return ret;
293+
goto out;
295294
}
296295

297-
return 0;
296+
if (ret == -ENOTSUPP)
297+
ret = 0;
298+
out:
299+
if (ret)
300+
domain->active--;
301+
mutex_unlock(&priv->mutex);
302+
303+
return ret;
298304
}
299305

300306
static int j721e_audio_hw_params(struct snd_pcm_substream *substream,

0 commit comments

Comments
 (0)