From 68ea7b2f2d8c1effd662fded04e9a589cb640da6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 15 Nov 2007 15:54:38 +0100 Subject: [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 Signed-off-by: Jaroslav Kysela --- sound/pci/hda/patch_conexant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/pci/hda/patch_conexant.c') diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index beda2978147..68f23b823e2 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -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) -- cgit v1.2.3