ALSA: hda - Fix oops caused by recent commit "Fix internal mic for Lenovo Ideapad...
authorDavid Henningsson <[email protected]>
Tue, 10 Apr 2012 11:05:29 +0000 (13:05 +0200)
committerTakashi Iwai <[email protected]>
Tue, 10 Apr 2012 12:55:01 +0000 (14:55 +0200)
Make sure we don't dereference the "quirk" pointer when it is null.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: David Henningsson <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
sound/pci/hda/patch_conexant.c

index cbe115b6c80cf9036e6aaa7a69aa15a7f76a75d7..abb59f472d4848720efc81acf95f2ebaa6f5bc39 100644 (file)
@@ -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]);