From 810352f7bc7ee8788c89660bec3b7790e1c215bc Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Tue, 10 Apr 2012 13:05:29 +0200 Subject: [PATCH] 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 --- sound/pci/hda/patch_conexant.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 94f0c4ade23bf..58c287be6b4cc 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -4463,7 +4463,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]); -- 2.47.3