ALSA: hda - make sure alc268 does not OOPS on codec parse
authorDavid Henningsson <david.henningsson@canonical.com>
Wed, 18 Jul 2012 16:02:53 +0000 (18:02 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 18 Jul 2012 16:07:03 +0000 (18:07 +0200)
A recent commit made patch_alc268 call snd_hda_pick_fixup with
NULL quirk pointer. Make sure we do not reference that NULL pointer.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_auto_parser.c

index f7520b9f909cfb0d577ed745bef272675b23477a..647218d69f6890862b5fcfd690dc9e09d29bc3ea 100644 (file)
@@ -727,7 +727,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
                        models++;
                }
        }
-       if (id < 0) {
+       if (id < 0 && quirk) {
                q = snd_pci_quirk_lookup(codec->bus->pci, quirk);
                if (q) {
                        id = q->value;
@@ -736,7 +736,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
 #endif
                }
        }
-       if (id < 0) {
+       if (id < 0 && quirk) {
                for (q = quirk; q->subvendor; q++) {
                        unsigned int vendorid =
                                q->subdevice | (q->subvendor << 16);