From: Axel Lin Date: Fri, 9 Jun 2017 07:01:21 +0000 (+0800) Subject: ASoC: ak4613: Fix out of bounds array access for ak4613_iface X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b5f2a487f524e6eeeec38651e7b58760ebfd843e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: ak4613: Fix out of bounds array access for ak4613_iface Signed-off-by: Axel Lin Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index b2dfddead227..987918628d5b 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -345,7 +345,7 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, if (ak4613_dai_fmt_matching(priv->iface, is_play, fmt, width)) iface = priv->iface; } else { - for (i = ARRAY_SIZE(ak4613_iface); i >= 0; i--) { + for (i = ARRAY_SIZE(ak4613_iface) - 1; i >= 0; i--) { if (!ak4613_dai_fmt_matching(ak4613_iface + i, is_play, fmt, width))