diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-18 17:52:14 (GMT) |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 11:29:08 (GMT) |
commit | b32425ac93370e1ba5556110e662f896b2e143b3 (patch) | |
tree | c5837ee90c16d2aa358e399f2ad79ca4eb770e94 /sound/drivers/opl3 | |
parent | 2eb061f41cf74f829bfe90a9c79c765172be9f0b (diff) | |
download | linux-b32425ac93370e1ba5556110e662f896b2e143b3.tar.xz |
[ALSA] Fix possible races in timer callbacks
Fix possible races in timer callbacks.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers/opl3')
-rw-r--r-- | sound/drivers/opl3/opl3_midi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c index 48c480e..1b6f227 100644 --- a/sound/drivers/opl3/opl3_midi.c +++ b/sound/drivers/opl3/opl3_midi.c @@ -238,10 +238,11 @@ void snd_opl3_timer_func(unsigned long data) { struct snd_opl3 *opl3 = (struct snd_opl3 *)data; + unsigned long flags; int again = 0; int i; - spin_lock(&opl3->sys_timer_lock); + spin_lock_irqsave(&opl3->sys_timer_lock, flags); for (i = 0; i < opl3->max_voices; i++) { struct snd_opl3_voice *vp = &opl3->voices[i]; if (vp->state > 0 && vp->note_off_check) { @@ -257,7 +258,7 @@ void snd_opl3_timer_func(unsigned long data) } else { opl3->sys_timer_status = 0; } - spin_unlock(&opl3->sys_timer_lock); + spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); } /* |