summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-01-13 08:08:08 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 15:14:05 -0800
commit088c4946cf44b5c71c4c9ee69f6df9d7621425be (patch)
treeb9012203a55f10a17c17656d26ec62703e45229d /sound
parentfada8d6ae6993a823ed022982e65445a26eb53bd (diff)
ALSA: hda - Fix NULL-derefence with a single mic in STAC auto-mic detection
commit 80c678526d7da73bde4d46a4622449c2b3c88409 upstream. When only one mic is available and it's an analog mic, the current IDT/STAC parser may give an Oops. Reference: bko#25692 https://bugzilla.kernel.org/show_bug.cgi?id=25692 Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index f03b2ff90496..fc16beba35af 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3591,7 +3591,7 @@ static int stac_check_auto_mic(struct hda_codec *codec)
if (check_mic_pin(codec, spec->dmic_nids[i],
&fixed, &ext, &dock))
return 0;
- if (!fixed && !ext && !dock)
+ if (!fixed || (!ext && !dock))
return 0; /* no input to switch */
if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
return 0; /* no unsol support */