Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5f2a487 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

ASoC: ak4613: Fix out of bounds array access for ak4613_iface

parent 2ea659a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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))
		if (ak4613_dai_fmt_matching(priv->iface, is_play, fmt, width))
			iface = priv->iface;
			iface = priv->iface;
	} else {
	} 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,
			if (!ak4613_dai_fmt_matching(ak4613_iface + i,
						     is_play,
						     is_play,
						     fmt, width))
						     fmt, width))