]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit5e5218c67afdd506246692a8b35aaf0d05ccda85
treed4f5fae79278f4fd747644df2123eadc222f9023
parenta2359a43dcaeb1dbc15efb33ca8326d8fd567e69
ALSA: line6: Assure canceling delayed work at disconnection

BugLink: https://bugs.launchpad.net/bugs/1838700
commit 0b074ab7fc0d575247b9cc9f93bb7e007ca38840 upstream.

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: 7f84ff68be05 ("ALSA: line6: toneport: Fix broken usage of timer for delayed execution")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/usb/line6/driver.c
sound/usb/line6/driver.h
sound/usb/line6/toneport.c