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

Commit d6c11177 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wcd934x: Fix out of bounds for mad input value" into msm-4.9

parents c4510568 5b976abb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5204,6 +5204,14 @@ static int tavil_mad_input_put(struct snd_kcontrol *kcontrol,

	tavil_mad_input = ucontrol->value.integer.value[0];

	if (tavil_mad_input >= sizeof(tavil_conn_mad_text)/
	    sizeof(tavil_conn_mad_text[0])) {
		dev_err(codec->dev,
			"%s: tavil_mad_input = %d out of bounds\n",
			__func__, tavil_mad_input);
		return -EINVAL;
	}

	if (strnstr(tavil_conn_mad_text[tavil_mad_input], "NOTUSED",
				sizeof("NOTUSED"))) {
		dev_dbg(codec->dev,