From: Phil Carmody Date: Wed, 14 Apr 2010 14:03:13 +0000 (+0300) Subject: ASoC: da7210: Fencepost error in reg cache read X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=4f6f22d7bef77dfb6b27eaed4240784339c546e6;p=deliverable%2Flinux.git ASoC: da7210: Fencepost error in reg cache read An index equal to the array size may not be accessed. Signed-off-by: Phil Carmody Acked-by: Kuninori Morimoto Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 89cea32f9424..b9cbaeb09e05 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -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]; }