summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/da7210.c
diff options
context:
space:
mode:
authorPhil Carmody2010-04-14 16:03:13 +0200
committerMark Brown2010-04-20 18:41:26 +0200
commit4f6f22d7bef77dfb6b27eaed4240784339c546e6 (patch)
tree94f2ad5fdfdf05f2b6488a5c7c98ed5cd10dda9b /sound/soc/codecs/da7210.c
parentASoC: missing conversions to snd_soc_codec_*_drvdata() (diff)
downloadkernel-qcow2-linux-4f6f22d7bef77dfb6b27eaed4240784339c546e6.tar.gz
kernel-qcow2-linux-4f6f22d7bef77dfb6b27eaed4240784339c546e6.tar.xz
kernel-qcow2-linux-4f6f22d7bef77dfb6b27eaed4240784339c546e6.zip
ASoC: da7210: Fencepost error in reg cache read
An index equal to the array size may not be accessed. Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/da7210.c')
-rw-r--r--sound/soc/codecs/da7210.c2
1 files changed, 1 insertions, 1 deletions
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];
}