Skip to content

Commit

Permalink
ASoC: wm8996: Fix negative array index read
Browse files Browse the repository at this point in the history
Spotted by coverity CID 146355.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Oct 30, 2013
1 parent 959f585 commit fe329a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/codecs/wm8996.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fe329a1

Please sign in to comment.