Skip to content

Commit

Permalink
ASoC: ml26124: Fix negative array index read
Browse files Browse the repository at this point in the history
get_coeff() may return an error.

Spotted by coverity CID 703394.

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 8b4b303
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/codecs/ml26124.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ static int ml26124_hw_params(struct snd_pcm_substream *substream,
struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec);
int i = get_coeff(priv->mclk, params_rate(hw_params));

if (i < 0)
return i;
priv->substream = substream;
priv->rate = params_rate(hw_params);

Expand Down

0 comments on commit 8b4b303

Please sign in to comment.