diff options
author | Wang YanQing <udknight@gmail.com> | 2013-05-06 23:27:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-05-07 01:31:59 -0400 |
commit | 2195b063f6609e4c6268f291683902f25eaf9aa6 (patch) | |
tree | 49673707b98bf6aa4dd3a150583d8137bc32568f /sound | |
parent | 5a4ca9b3fa24f81298c13a27c03c6dd4087ca159 (diff) |
ALSA: HDA: Fix Oops caused by dereference NULL pointer
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 6f9b64700f6e..86674f67abd1 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -681,6 +681,9 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex) | |||
681 | struct hda_bus_unsolicited *unsol; | 681 | struct hda_bus_unsolicited *unsol; |
682 | unsigned int wp; | 682 | unsigned int wp; |
683 | 683 | ||
684 | if (!bus || !bus->workq) | ||
685 | return 0; | ||
686 | |||
684 | trace_hda_unsol_event(bus, res, res_ex); | 687 | trace_hda_unsol_event(bus, res, res_ex); |
685 | unsol = bus->unsol; | 688 | unsol = bus->unsol; |
686 | if (!unsol) | 689 | if (!unsol) |