]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: line6: Assure canceling delayed work at disconnection
authorTakashi Iwai <tiwai@suse.de>
Tue, 28 May 2019 06:39:44 +0000 (08:39 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 28 May 2019 06:42:45 +0000 (08:42 +0200)
commitf8f7c6e4576b3fb15c1fa2fd36bea873904bafe1
treeaa64c8c81a16725f8f7e88199f095539e9f17365
parentef6bbe0981a2014cc1afb54716fa745e94b39d9d
ALSA: line6: Assure canceling delayed work at disconnection

The current code performs the cancel of a delayed work at the late
stage of disconnection procedure, which may lead to the access to the
already cleared state.

This patch assures to call cancel_delayed_work_sync() at the beginning
of the disconnection procedure for avoiding that race.  The delayed
work object is now assigned in the common line6 object instead of its
derivative, so that we can call cancel_delayed_work_sync().

Along with the change, the startup function is called via the new
callback instead.  This will make it easier to port other LINE6
drivers to use the delayed work for startup in later patches.

Reported-by: syzbot+5255458d5e0a2b10bbb9@syzkaller.appspotmail.com
Fixes: 26cbaaf833cc ("ALSA: line6: toneport: Fix broken usage of timer for delayed execution")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/line6/driver.c
sound/usb/line6/driver.h
sound/usb/line6/toneport.c