Skip to content

Commit

Permalink
ASoC: da7210: Fencepost error in reg cache read
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Carmody authored and Mark Brown committed Apr 20, 2010
1 parent d4a8ca2 commit 4f6f22d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/da7210.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit 4f6f22d

Please sign in to comment.