lkml.org 
[lkml]   [2013]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[14/94] ALSA: HDA: Fix Oops caused by dereference NULL pointer
    3.2.46-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Wang YanQing <udknight@gmail.com>

    commit 2195b063f6609e4c6268f291683902f25eaf9aa6 upstream.

    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>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    sound/pci/hda/hda_codec.c | 3 +++
    1 file changed, 3 insertions(+)

    --- a/sound/pci/hda/hda_codec.c
    +++ b/sound/pci/hda/hda_codec.c
    @@ -615,6 +615,9 @@ int snd_hda_queue_unsol_event(struct hda
    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)


    \
     
     \ /
      Last update: 2013-05-28 06:42    [W:3.631 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site