summaryrefslogtreecommitdiff
path: root/sound/pci/korg1212
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-18 20:52:14 +0300
committerJaroslav Kysela <perex@suse.cz>2006-01-03 14:29:08 +0300
commitb32425ac93370e1ba5556110e662f896b2e143b3 (patch)
treec5837ee90c16d2aa358e399f2ad79ca4eb770e94 /sound/pci/korg1212
parent2eb061f41cf74f829bfe90a9c79c765172be9f0b (diff)
downloadlinux-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/pci/korg1212')
-rw-r--r--sound/pci/korg1212/korg1212.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index a8a6a5c41a7f..4eddb512c12f 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -609,8 +609,9 @@ static void snd_korg1212_SendStopAndWait(struct snd_korg1212 *korg1212)
static void snd_korg1212_timer_func(unsigned long data)
{
struct snd_korg1212 *korg1212 = (struct snd_korg1212 *) data;
+ unsigned long flags;
- spin_lock(&korg1212->lock);
+ spin_lock_irqsave(&korg1212->lock, flags);
if (korg1212->sharedBufferPtr->cardCommand == 0) {
/* ack'ed */
korg1212->stop_pending_cnt = 0;
@@ -632,7 +633,7 @@ static void snd_korg1212_timer_func(unsigned long data)
stateName[korg1212->cardState]);
}
}
- spin_unlock(&korg1212->lock);
+ spin_unlock_irqrestore(&korg1212->lock, flags);
}
static int snd_korg1212_TurnOnIdleMonitor(struct snd_korg1212 *korg1212)