mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[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 <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]>
This commit is contained in:
parent
498ade1a13
commit
3b89246778
6 changed files with 36 additions and 8 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue