]> git.baikalelectronics.ru Git - 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)
commit228612b7a8ba4b7cd4cfa7e0e9e318ee16984631
tree7989623430877bfdbb32e446b8f7ce64c0de3555
parente0a69cc2440fa4533a82b823c33c5ee7610c5420
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