diff options
| author | Takashi Iwai <tiwai@suse.de> | 2005-11-18 12:52:14 -0500 |
|---|---|---|
| committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:29:08 -0500 |
| commit | b32425ac93370e1ba5556110e662f896b2e143b3 (patch) | |
| tree | c5837ee90c16d2aa358e399f2ad79ca4eb770e94 /sound/synth | |
| parent | 2eb061f41cf74f829bfe90a9c79c765172be9f0b (diff) | |
[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/synth')
| -rw-r--r-- | sound/synth/emux/emux_synth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c index c387a83a655e..24705d15ebd8 100644 --- a/sound/synth/emux/emux_synth.c +++ b/sound/synth/emux/emux_synth.c | |||
| @@ -205,9 +205,10 @@ void snd_emux_timer_callback(unsigned long data) | |||
| 205 | { | 205 | { |
| 206 | struct snd_emux *emu = (struct snd_emux *) data; | 206 | struct snd_emux *emu = (struct snd_emux *) data; |
| 207 | struct snd_emux_voice *vp; | 207 | struct snd_emux_voice *vp; |
| 208 | unsigned long flags; | ||
| 208 | int ch, do_again = 0; | 209 | int ch, do_again = 0; |
| 209 | 210 | ||
| 210 | spin_lock(&emu->voice_lock); | 211 | spin_lock_irqsave(&emu->voice_lock, flags); |
| 211 | for (ch = 0; ch < emu->max_voices; ch++) { | 212 | for (ch = 0; ch < emu->max_voices; ch++) { |
| 212 | vp = &emu->voices[ch]; | 213 | vp = &emu->voices[ch]; |
| 213 | if (vp->state == SNDRV_EMUX_ST_PENDING) { | 214 | if (vp->state == SNDRV_EMUX_ST_PENDING) { |
| @@ -225,7 +226,7 @@ void snd_emux_timer_callback(unsigned long data) | |||
| 225 | emu->timer_active = 1; | 226 | emu->timer_active = 1; |
| 226 | } else | 227 | } else |
| 227 | emu->timer_active = 0; | 228 | emu->timer_active = 0; |
| 228 | spin_unlock(&emu->voice_lock); | 229 | spin_unlock_irqrestore(&emu->voice_lock, flags); |
| 229 | } | 230 | } |
| 230 | 231 | ||
| 231 | /* | 232 | /* |
