[ALSA] Check value range in ctl callbacks

Check the value ranges in ctl put callbacks properly (in the rest drivers).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Takashi Iwai
2007-11-15 16:17:24 +01:00
committed by Jaroslav Kysela
parent 498ade1a13
commit 3b89246778
6 changed files with 36 additions and 8 deletions

View File

@@ -113,6 +113,8 @@ static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
val0 = 79 - ucontrol->value.integer.value[0];
val1 = 79 - ucontrol->value.integer.value[1];
if (val0 < 0 || val0 > 79 || val1 < 0 || val1 > 79)
return -EINVAL;
if (val0 == pt->volume[base] && val1 == pt->volume[base + 1])
return 0;