• Takashi Iwai's avatar
    ALSA: line6: Fix missing initialization before error path · cb02ffc7
    Takashi Iwai authored
    The error path in podhd_init() tries to clear the pending timer, while
    the timer object is initialized at the end of init sequence, thus it
    may hit the uninitialized object, as spotted by syzkaller:
    
      INFO: trying to register non-static key.
      the code is fine but needs lockdep annotation.
      turning off the locking correctness validator.
      CPU: 1 PID: 1845 Comm: kworker/1:2 Not tainted
      4.14.0-rc2-42613-g1488251d1a98 #238
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Workqueue: usb_hub_wq hub_event
      Call Trace:
       __dump_stack lib/dump_stack.c:16
       dump_stack+0x292/0x395 lib/dump_stack.c:52
       register_lock_class+0x6c4/0x1a00 kernel/locking/lockdep.c:769
       __lock_acquire+0x27e/0x4550 kernel/locking/lockdep.c:3385
       lock_acquire+0x259/0x620 kernel/locking/lockdep.c:4002
       del_timer_sync+0x12c/0x280 kernel/time/timer.c:1237
       podhd_disconnect+0x8c/0x160 sound/usb/line6/podhd.c:299
       line6_probe+0x844/0x1310 sound/usb/line6/driver.c:783
       podhd_probe+0x64/0x70 sound/usb/line6/podhd.c:474
       ....
    
    For addressing it, assure the initializations of timer and work by
    moving them to the beginning of podhd_init().
    
    Fixes: 790869da ("ALSA: line6: Add support for POD X3")
    Reported-by: 's avatarAndrey Konovalov <andreyknvl@google.com>
    Tested-by: 's avatarAndrey Konovalov <andreyknvl@google.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
    cb02ffc7
Name
Last commit
Last update
..
6fire Loading commit data...
bcd2000 Loading commit data...
caiaq Loading commit data...
hiface Loading commit data...
line6 Loading commit data...
misc Loading commit data...
usx2y Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
card.c Loading commit data...
card.h Loading commit data...
clock.c Loading commit data...
clock.h Loading commit data...
debug.h Loading commit data...
endpoint.c Loading commit data...
endpoint.h Loading commit data...
format.c Loading commit data...
format.h Loading commit data...
helper.c Loading commit data...
helper.h Loading commit data...
midi.c Loading commit data...
midi.h Loading commit data...
mixer.c Loading commit data...
mixer.h Loading commit data...
mixer_maps.c Loading commit data...
mixer_quirks.c Loading commit data...
mixer_quirks.h Loading commit data...
mixer_scarlett.c Loading commit data...
mixer_scarlett.h Loading commit data...
mixer_us16x08.c Loading commit data...
mixer_us16x08.h Loading commit data...
pcm.c Loading commit data...
pcm.h Loading commit data...
power.h Loading commit data...
proc.c Loading commit data...
proc.h Loading commit data...
quirks-table.h Loading commit data...
quirks.c Loading commit data...
quirks.h Loading commit data...
stream.c Loading commit data...
stream.h Loading commit data...
usbaudio.h Loading commit data...