From: Takashi Iwai Date: Mon, 18 Dec 2006 15:16:04 +0000 (+0100) Subject: [ALSA] hda-codec - Fix NULL dereference in generic hda code X-Git-Tag: v2.6.20-rc5~32^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6afeb11de5b28e47adea1459c35e598bb98424d6;p=linux-2.6 [ALSA] hda-codec - Fix NULL dereference in generic hda code Fix NULL dereference in hda_generic.c. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 97e9af130b..1589d2f291 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -485,8 +485,9 @@ static const char *get_input_type(struct hda_gnode *node, unsigned int *pinctl) return "Front Aux"; return "Aux"; case AC_JACK_MIC_IN: - if (node->pin_caps & - (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT)) + if (pinctl && + (node->pin_caps & + (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT))) *pinctl |= AC_PINCTL_VREF_80; if ((location & 0x0f) == AC_JACK_LOC_FRONT) return "Front Mic";