linux/sound/usb/line6
Takashi Iwai 0b074ab7fc 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: 7f84ff68be ("ALSA: line6: toneport: Fix broken usage of timer for delayed execution")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-05-28 08:42:45 +02:00
..
capture.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
capture.h ALSA: line6: make snd_pcm_ops const 2017-10-02 14:33:23 +02:00
driver.c ALSA: line6: Assure canceling delayed work at disconnection 2019-05-28 08:42:45 +02:00
driver.h ALSA: line6: Assure canceling delayed work at disconnection 2019-05-28 08:42:45 +02:00
Kconfig ALSA: line6: snd-usb-line6 depends on CONFIG_SND_HWDEP 2016-09-21 14:36:22 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
midi.c ALSA: line6: Use correct endpoint type for midi output 2018-04-12 08:42:07 +02:00
midi.h ALSA: line6: Tidy up and typo fixes in comments 2015-01-28 20:54:43 +01:00
midibuf.c ALSA: line6: Remove unused line6_midibuf_skip_message() 2015-02-01 09:35:25 +01:00
midibuf.h ALSA: line6: Remove unused line6_midibuf_skip_message() 2015-02-01 09:35:25 +01:00
pcm.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
pcm.h ALSA: line6: Add LINE6_CAP_IN_NEEDS_OUT, a void playback stream during capture 2016-09-19 23:00:37 +02:00
playback.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
playback.h ALSA: line6: make snd_pcm_ops const 2017-10-02 14:33:23 +02:00
pod.c ALSA: line6: fix check on snd_card_register 2019-01-07 11:58:30 +01:00
podhd.c ALSA: line6: use dynamic buffers 2019-04-28 18:40:26 +02:00
toneport.c ALSA: line6: Assure canceling delayed work at disconnection 2019-05-28 08:42:45 +02:00
variax.c ALSA: usb-audio: Convert timers to use timer_setup() 2017-10-17 10:52:22 +02:00