[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:
committed by
Jaroslav Kysela
parent
498ade1a13
commit
3b89246778
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user