From: Takashi Iwai Date: Wed, 30 Oct 2013 17:40:04 +0000 (+0100) Subject: ASoC: ml26124: Fix negative array index read X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8b4b30365ce6cefe4193f439ac7263bb2cdd66fd;p=linux-beck.git ASoC: ml26124: Fix negative array index read get_coeff() may return an error. Spotted by coverity CID 703394. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- 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, 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);