ALSA: usx2y: Fix unlocked snd_pcm_stop() call
[pandora-kernel.git] / sound / usb / usx2y / usbusx2yaudio.c
index 5d37d1c..d5724d8 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
+#include <linux/moduleparam.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/pcm.h>
@@ -272,7 +273,11 @@ static void usX2Y_clients_stop(struct usX2Ydev *usX2Y)
                struct snd_usX2Y_substream *subs = usX2Y->subs[s];
                if (subs) {
                        if (atomic_read(&subs->state) >= state_PRERUNNING) {
+                               unsigned long flags;
+
+                               snd_pcm_stream_lock_irqsave(subs->pcm_substream, flags);
                                snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN);
+                               snd_pcm_stream_unlock_irqrestore(subs->pcm_substream, flags);
                        }
                        for (u = 0; u < NRURBS; u++) {
                                struct urb *urb = subs->urb[u];