aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2017-06-09 15:01:21 +0800
committerMark Brown <broonie@kernel.org>2017-06-09 18:39:25 +0100
commitb5f2a487f524e6eeeec38651e7b58760ebfd843e (patch)
treed5ae3d10a74d50812d0afa7a9c1eade9efa27b16 /sound/soc
parentLinux 4.12-rc1 (diff)
downloadlinux-dev-b5f2a487f524e6eeeec38651e7b58760ebfd843e.tar.xz
linux-dev-b5f2a487f524e6eeeec38651e7b58760ebfd843e.zip
ASoC: ak4613: Fix out of bounds array access for ak4613_iface
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/ak4613.c2
1 files changed, 1 insertions, 1 deletions
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))