From 4e98d6a7ce934b19bffb309f2522b22384355fef Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 15 Nov 2007 15:58:13 +0100 Subject: [ALSA] pci - check value range in ctl callbacks Check the value ranges in ctl put callbacks properly in the rest of PCI drivers. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/pci/ymfpci/ymfpci_main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/pci/ymfpci/ymfpci_main.c') diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 1fe39ed28765..c0789a50ad20 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -1735,6 +1735,10 @@ static int snd_ymfpci_pcm_vol_put(struct snd_kcontrol *kcontrol, ucontrol->value.integer.value[1] != chip->pcm_mixer[subs].right) { chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; chip->pcm_mixer[subs].right = ucontrol->value.integer.value[1]; + if (chip->pcm_mixer[subs].left > 0x8000) + chip->pcm_mixer[subs].left = 0x8000; + if (chip->pcm_mixer[subs].right > 0x8000) + chip->pcm_mixer[subs].right = 0x8000; substream = (struct snd_pcm_substream *)kcontrol->private_value; spin_lock_irqsave(&chip->voice_lock, flags); -- cgit v1.2.3