Commit edd1365e authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Takashi Iwai

sound: vx222: fix input level control range check

Fix a logic error in the range check of the input level control that
would prevent setting any volume less than the maximum.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 70bdbd3d
...@@ -885,10 +885,10 @@ static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem ...@@ -885,10 +885,10 @@ static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct vx_core *_chip = snd_kcontrol_chip(kcontrol);
struct snd_vx222 *chip = (struct snd_vx222 *)_chip; struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
if (ucontrol->value.integer.value[0] < 0 || if (ucontrol->value.integer.value[0] < 0 ||
ucontrol->value.integer.value[0] < MIC_LEVEL_MAX) ucontrol->value.integer.value[0] > MIC_LEVEL_MAX)
return -EINVAL; return -EINVAL;
if (ucontrol->value.integer.value[1] < 0 || if (ucontrol->value.integer.value[1] < 0 ||
ucontrol->value.integer.value[1] < MIC_LEVEL_MAX) ucontrol->value.integer.value[1] > MIC_LEVEL_MAX)
return -EINVAL; return -EINVAL;
mutex_lock(&_chip->mixer_mutex); mutex_lock(&_chip->mixer_mutex);
if (chip->input_level[0] != ucontrol->value.integer.value[0] || if (chip->input_level[0] != ucontrol->value.integer.value[0] ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment