Merge "ASoC: wcd9335: Fix out of bounds for mad input value"

This commit is contained in:
Linux Build Service Account 2016-12-30 06:27:41 -08:00 committed by Gerrit - the friendly Code Review server
commit e8cece702f

View file

@ -7931,6 +7931,13 @@ static int tasha_mad_input_put(struct snd_kcontrol *kcontrol,
tasha_mad_input = ucontrol->value.integer.value[0];
if (tasha_mad_input >= ARRAY_SIZE(tasha_conn_mad_text)) {
dev_err(codec->dev,
"%s: tasha_mad_input = %d out of bounds\n",
__func__, tasha_mad_input);
return -EINVAL;
}
if (!strcmp(tasha_conn_mad_text[tasha_mad_input], "NOTUSED1") ||
!strcmp(tasha_conn_mad_text[tasha_mad_input], "NOTUSED2") ||
!strcmp(tasha_conn_mad_text[tasha_mad_input], "NOTUSED3") ||