diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-11-15 09:58:13 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:24 -0500 |
commit | 4e98d6a7ce934b19bffb309f2522b22384355fef (patch) | |
tree | 8613aee414a855314663de2575f2bee284c8430c /sound/pci/ymfpci | |
parent | ab2dac2bdcf562dd616bd1fadddf5078ae7c3d83 (diff) |
[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 <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/ymfpci')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, | |||
1735 | ucontrol->value.integer.value[1] != chip->pcm_mixer[subs].right) { | 1735 | ucontrol->value.integer.value[1] != chip->pcm_mixer[subs].right) { |
1736 | chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; | 1736 | chip->pcm_mixer[subs].left = ucontrol->value.integer.value[0]; |
1737 | chip->pcm_mixer[subs].right = ucontrol->value.integer.value[1]; | 1737 | chip->pcm_mixer[subs].right = ucontrol->value.integer.value[1]; |
1738 | if (chip->pcm_mixer[subs].left > 0x8000) | ||
1739 | chip->pcm_mixer[subs].left = 0x8000; | ||
1740 | if (chip->pcm_mixer[subs].right > 0x8000) | ||
1741 | chip->pcm_mixer[subs].right = 0x8000; | ||
1738 | 1742 | ||
1739 | substream = (struct snd_pcm_substream *)kcontrol->private_value; | 1743 | substream = (struct snd_pcm_substream *)kcontrol->private_value; |
1740 | spin_lock_irqsave(&chip->voice_lock, flags); | 1744 | spin_lock_irqsave(&chip->voice_lock, flags); |