summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2018-10-26 16:54:43 -0500
committerMark Brown <broonie@kernel.org>2018-10-30 15:31:11 +0000
commit23cb2d04db54535df65edbbebbca89f2590f08bd (patch)
treec2bc64504ac370c39323c4d97cd03abd2952be4f
parent409fa67a7f4a68f6990955849c22eaca589f18c0 (diff)
downloadlinux-23cb2d04db54535df65edbbebbca89f2590f08bd.tar.gz
linux-23cb2d04db54535df65edbbebbca89f2590f08bd.tar.bz2
linux-23cb2d04db54535df65edbbebbca89f2590f08bd.zip
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>
-rw-r--r--include/sound/soc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f1dab1f4b194..70c10a8f3e90 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -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 */