aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-01-13 02:08:08 -0500
committerTakashi Iwai <tiwai@suse.de>2011-01-13 02:29:12 -0500
commit80c678526d7da73bde4d46a4622449c2b3c88409 (patch)
treed639335446b65d51b7951df47779ca336423a9a8 /sound/pci/hda
parent700b65cee958d81b16c48378d5759c46d01e24d0 (diff)
ALSA: hda - Fix NULL-derefence with a single mic in STAC auto-mic detection
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> Cc: <stable@kernel.org>
Diffstat (limited to 'sound/pci/hda')
-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 c8d812ecb943..4ab019d0924e 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3594,7 +3594,7 @@ static int stac_check_auto_mic(struct hda_codec *codec)
3594 if (check_mic_pin(codec, spec->dmic_nids[i], 3594 if (check_mic_pin(codec, spec->dmic_nids[i],
3595 &fixed, &ext, &dock)) 3595 &fixed, &ext, &dock))
3596 return 0; 3596 return 0;
3597 if (!fixed && !ext && !dock) 3597 if (!fixed || (!ext && !dock))
3598 return 0; /* no input to switch */ 3598 return 0; /* no input to switch */
3599 if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) 3599 if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
3600 return 0; /* no unsol support */ 3600 return 0; /* no unsol support */