summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-30 08:35:07 +0100
committerMark Brown <broonie@linaro.org>2013-10-30 09:50:21 -0700
commitfe329a1a92cfe2d0c7e04fe3bc63761dc0f35950 (patch)
treec33a30be73bee8f345fd7b6636443a8ccecad646
parent959f58544b7f20c92d5eb43d1232c96c15c01bfb (diff)
ASoC: wm8996: Fix negative array index read
Spotted by coverity CID 146355. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/codecs/wm8996.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 46fe83d2b224..b70379ebd142 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -438,6 +438,8 @@ static int wm8996_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
int block = wm8996_get_retune_mobile_block(kcontrol->id.name);
+ if (block < 0)
+ return block;
ucontrol->value.enumerated.item[0] = wm8996->retune_mobile_cfg[block];
return 0;