• Takashi Iwai's avatar
    ALSA: sb: Minor optimization / fix of timer usage in sb8_midi.c · 20e5f8bf
    Takashi Iwai authored
    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: default avatarTakashi Iwai <tiwai@suse.de>
    20e5f8bf
sb8_midi.c 8.14 KB