diff options
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r-- | sound/soc/codecs/twl4030.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index ddc9f37d863f..f530c1e6d9e8 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -125,6 +125,9 @@ static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec, | |||
125 | { | 125 | { |
126 | u8 *cache = codec->reg_cache; | 126 | u8 *cache = codec->reg_cache; |
127 | 127 | ||
128 | if (reg >= TWL4030_CACHEREGNUM) | ||
129 | return -EIO; | ||
130 | |||
128 | return cache[reg]; | 131 | return cache[reg]; |
129 | } | 132 | } |
130 | 133 | ||