提交 4f6f22d7 编写于 作者: P Phil Carmody 提交者: Mark Brown

ASoC: da7210: Fencepost error in reg cache read

An index equal to the array size may not be accessed.
Signed-off-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: NLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 d4a8ca24
......@@ -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];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册