Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b4b3036 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown
Browse files

ASoC: ml26124: Fix negative array index read



get_coeff() may return an error.

Spotted by coverity CID 703394.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 959f5854
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -342,6 +342,8 @@ static int ml26124_hw_params(struct snd_pcm_substream *substream,
	struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec);
	struct ml26124_priv *priv = snd_soc_codec_get_drvdata(codec);
	int i = get_coeff(priv->mclk, params_rate(hw_params));
	int i = get_coeff(priv->mclk, params_rate(hw_params));


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