Commit 8b4b30365ce6cefe4193f439ac7263bb2cdd66fd

Authored by Takashi Iwai
Committed by Mark Brown
1 parent 959f58544b

ASoC: ml26124: Fix negative array index read

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>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

sound/soc/codecs/ml26124.c
... ... @@ -342,6 +342,8 @@
342 342 struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec);
343 343 int i = get_coeff(priv->mclk, params_rate(hw_params));
344 344  
  345 + if (i < 0)
  346 + return i;
345 347 priv->substream = substream;
346 348 priv->rate = params_rate(hw_params);
347 349