mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 18:36:00 +00:00
ASoC: fix oops w/ for_each_rtd_codec_dai_rollback() macro
A kernel oops happens on an error case (usual missing BE mixer configuration required by Intel SST driver). Git bisect points to this macro and an operator precedence issue. for (; ((i--) >= 0) && ((dai) = rtd->codec_dais[i]);) The initial code replaced by this macro was while (--i >= 0) { codec_dai = rtd->codec_dais[i]; Fix the C operator precedence difference by reverting to pre-decrement Fixes: 0b7990e3897 ('ASoC: add for_each_rtd_codec_dai() macro') Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
409fa67a7f
commit
23cb2d04db
@ -1192,7 +1192,7 @@ struct snd_soc_pcm_runtime {
|
||||
((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
|
||||
(i)++)
|
||||
#define for_each_rtd_codec_dai_rollback(rtd, i, dai) \
|
||||
for (; ((i--) >= 0) && ((dai) = rtd->codec_dais[i]);)
|
||||
for (; ((--i) >= 0) && ((dai) = rtd->codec_dais[i]);)
|
||||
|
||||
|
||||
/* mixer control */
|
||||
|
Loading…
x
Reference in New Issue
Block a user