ALSA: asihpi: Fix unlocked snd_pcm_stop() call
authorTakashi Iwai <tiwai@suse.de>
Thu, 11 Jul 2013 15:55:57 +0000 (17:55 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 2 Aug 2013 20:14:56 +0000 (22:14 +0200)
commit 60478295d6876619f8f47f6d1a5c25eaade69ee3 upstream.

snd_pcm_stop() must be called in the PCM substream lock context.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/pci/asihpi/asihpi.c

index f4b9e2b..fbf0bcd 100644 (file)
@@ -768,7 +768,10 @@ static void snd_card_asihpi_timer_function(unsigned long data)
                                                s->number);
                                ds->drained_count++;
                                if (ds->drained_count > 2) {
                                                s->number);
                                ds->drained_count++;
                                if (ds->drained_count > 2) {
+                                       unsigned long flags;
+                                       snd_pcm_stream_lock_irqsave(s, flags);
                                        snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN);
                                        snd_pcm_stop(s, SNDRV_PCM_STATE_XRUN);
+                                       snd_pcm_stream_unlock_irqrestore(s, flags);
                                        continue;
                                }
                        } else {
                                        continue;
                                }
                        } else {