[ALSA] hda-codec - Check value range in ctl callbacks
Check the value ranges in ctl put callbacks properly so that invalid values won't be stored or written to registers. 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
7e39e2273a
commit
68ea7b2f2d
@@ -373,7 +373,7 @@ static int cxt_eapd_put(struct snd_kcontrol *kcontrol,
|
||||
hda_nid_t nid = kcontrol->private_value & 0xff;
|
||||
unsigned int eapd;
|
||||
|
||||
eapd = ucontrol->value.integer.value[0];
|
||||
eapd = !!ucontrol->value.integer.value[0];
|
||||
if (invert)
|
||||
eapd = !eapd;
|
||||
if (eapd == spec->cur_eapd)
|
||||
|
Reference in New Issue
Block a user