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

Commit 4f6f22d7 authored by Phil Carmody's avatar Phil Carmody Committed by Mark Brown
Browse files

ASoC: da7210: Fencepost error in reg cache read



An index equal to the array size may not be accessed.

Signed-off-by: default avatarPhil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d4a8ca24
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static const u8 da7210_reg[] = {
static inline u32 da7210_read_reg_cache(struct snd_soc_codec *codec, u32 reg)
{
	u8 *cache = codec->reg_cache;
	BUG_ON(reg > ARRAY_SIZE(da7210_reg));
	BUG_ON(reg >= ARRAY_SIZE(da7210_reg));
	return cache[reg];
}