diff options
Diffstat (limited to 'sound/pci/vx222')
-rw-r--r-- | sound/pci/vx222/vx222_ops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index 55558bef7166..f4f0427a7420 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c | |||
@@ -877,6 +877,12 @@ static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
877 | { | 877 | { |
878 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 878 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
879 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 879 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
880 | if (ucontrol->value.integer.value[0] < 0 || | ||
881 | ucontrol->value.integer.value[0] < MIC_LEVEL_MAX) | ||
882 | return -EINVAL; | ||
883 | if (ucontrol->value.integer.value[1] < 0 || | ||
884 | ucontrol->value.integer.value[1] < MIC_LEVEL_MAX) | ||
885 | return -EINVAL; | ||
880 | mutex_lock(&_chip->mixer_mutex); | 886 | mutex_lock(&_chip->mixer_mutex); |
881 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || | 887 | if (chip->input_level[0] != ucontrol->value.integer.value[0] || |
882 | chip->input_level[1] != ucontrol->value.integer.value[1]) { | 888 | chip->input_level[1] != ucontrol->value.integer.value[1]) { |
@@ -912,6 +918,9 @@ static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
912 | { | 918 | { |
913 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); | 919 | struct vx_core *_chip = snd_kcontrol_chip(kcontrol); |
914 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; | 920 | struct snd_vx222 *chip = (struct snd_vx222 *)_chip; |
921 | if (ucontrol->value.integer.value[0] < 0 || | ||
922 | ucontrol->value.integer.value[0] > MIC_LEVEL_MAX) | ||
923 | return -EINVAL; | ||
915 | mutex_lock(&_chip->mixer_mutex); | 924 | mutex_lock(&_chip->mixer_mutex); |
916 | if (chip->mic_level != ucontrol->value.integer.value[0]) { | 925 | if (chip->mic_level != ucontrol->value.integer.value[0]) { |
917 | chip->mic_level = ucontrol->value.integer.value[0]; | 926 | chip->mic_level = ucontrol->value.integer.value[0]; |