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: v3.4.92~97 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=d3ecba4704c3e15008eea16333710383f7d99f62;p=unionfs-2.6.36.y.git ALSA: hda - Fix oops caused by recent commit "Fix internal mic for Lenovo Ideapad U300s" commit 83b0c6ba999643ee8ad6329f26e1cdc870e1a920 upstream. 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 Signed-off-by: Ben Hutchings Cc: Weng Meiling Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index a0c3ac32eb9..d4caf87615d 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -4430,7 +4430,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]);