From: David Henningsson Date: Tue, 10 Apr 2012 11:05:29 +0000 (+0200) Subject: ALSA: hda - Fix oops caused by recent commit "Fix internal mic for Lenovo Ideapad... X-Git-Tag: perf-core-for-mingo~34^2~2^2~26 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=83b0c6ba999643ee8ad6329f26e1cdc870e1a920;p=uclinux-h8%2Flinux.git ALSA: hda - Fix oops caused by recent commit "Fix internal mic for Lenovo Ideapad U300s" Make sure we don't dereference the "quirk" pointer when it is null. Reported-by: Dan Carpenter Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index cbe115b6c80c..abb59f472d48 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -4441,7 +4441,9 @@ static void apply_fixup(struct hda_codec *codec, struct conexant_spec *spec = codec->spec; quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); - if (quirk && table[quirk->value]) { + if (!quirk) + return; + if (table[quirk->value]) { snd_printdd(KERN_INFO "hda_codec: applying pincfg for %s\n", quirk->name); apply_pincfg(codec, table[quirk->value]);