diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-10-30 13:40:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-30 17:33:08 -0400 |
commit | 8b4b30365ce6cefe4193f439ac7263bb2cdd66fd (patch) | |
tree | 5db0795617431271b6381232c99bb36bc1c439bd /sound/soc | |
parent | 959f58544b7f20c92d5eb43d1232c96c15c01bfb (diff) |
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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/ml26124.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c index 26118828782b..185fa3bc3052 100644 --- a/sound/soc/codecs/ml26124.c +++ b/sound/soc/codecs/ml26124.c | |||
@@ -342,6 +342,8 @@ static int ml26124_hw_params(struct snd_pcm_substream *substream, | |||
342 | struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec); | 342 | struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec); |
343 | int i = get_coeff(priv->mclk, params_rate(hw_params)); | 343 | int i = get_coeff(priv->mclk, params_rate(hw_params)); |
344 | 344 | ||
345 | if (i < 0) | ||
346 | return i; | ||
345 | priv->substream = substream; | 347 | priv->substream = substream; |
346 | priv->rate = params_rate(hw_params); | 348 | priv->rate = params_rate(hw_params); |
347 | 349 | ||