]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: hda - Fix oops caused by recent commit "Fix internal mic for Lenovo Ideapad...
authorDavid Henningsson <david.henningsson@canonical.com>
Tue, 10 Apr 2012 11:05:29 +0000 (13:05 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 30 Oct 2012 23:26:28 +0000 (23:26 +0000)
commit 83b0c6ba999643ee8ad6329f26e1cdc870e1a920 upstream.

Make sure we don't dereference the "quirk" pointer when it is null.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/pci/hda/patch_conexant.c

index 94f0c4ade23bf9577c5d7e72a804072f7c3375ad..58c287be6b4ccbc697ee25228a70b6d2615fb57a 100644 (file)
@@ -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]);