]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ALSA: sb: Minor optimization / fix of timer usage in sb8_midi.c
authorTakashi Iwai <tiwai@suse.de>
Wed, 25 Oct 2017 08:00:43 +0000 (10:00 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 25 Oct 2017 08:00:43 +0000 (10:00 +0200)
commit20e5f8bfb153bdd43b5be194658f8ad814470a5d
tree7989623430877bfdbb32e446b8f7ce64c0de3555
parent4f928246f0e8f9bda88f41131ec447a1b8193dbc
ALSA: sb: Minor optimization / fix of timer usage in sb8_midi.c

Currently the SB8 MIDI code sets up the timer object at each time
before scheduling it at trigger callback, but basically this is
superfluous once after set up.  Also, the code misses the
del_timer_sync() call that may leave a race condition for
use-after-free.

This patch addresses these issues, moving timer_setup() to
snd_sb8dsp_midi(), and adding the del_timer_sync() call at
snd_sb8dsp_midi_output_trigger() to make sure.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/sb/sb8_midi.c