ALSA: HDA: Fix Oops caused by dereference NULL pointer
authorWang YanQing <udknight@gmail.com>
Tue, 7 May 2013 03:27:33 +0000 (11:27 +0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 7 May 2013 05:31:59 +0000 (07:31 +0200)
The interrupt handler azx_interrupt will call azx_update_rirb,
which may call snd_hda_queue_unsol_event, snd_hda_queue_unsol_event
will dereference chip->bus pointer.

The problem is we alloc chip->bus in azx_codec_create
which will be called after we enable IRQ and enable unsolicited
event in azx_probe.

This will cause Oops due dereference NULL pointer. I meet it, good luck:)

[Rearranged the NULL check before the tracepoint and added another
 NULL check of bus->workq -- tiwai]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c

index 6f9b64700f6e48ec859bb7153a5bc119812062b4..86674f67abd15295df5837283f47eb0b1dcc1c7a 100644 (file)
@@ -681,6 +681,9 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
        struct hda_bus_unsolicited *unsol;
        unsigned int wp;
 
+       if (!bus || !bus->workq)
+               return 0;
+
        trace_hda_unsol_event(bus, res, res_ex);
        unsol = bus->unsol;
        if (!unsol)
This page took 0.027475 seconds and 5 git commands to generate.