aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-07-11 11:58:25 -0400
committerTakashi Iwai <tiwai@suse.de>2013-07-15 15:24:57 -0400
commit9538aa46c2427d6782aa10036c4da4c541605e0e (patch)
tree51a458d566f4650ddb53014190f0deb78eac4b07 /sound
parent5b9ab3f7324a1b94a5a5a76d44cf92dfeb3b5e80 (diff)
ALSA: ua101: Fix unlocked snd_pcm_stop() call
snd_pcm_stop() must be called in the PCM substream lock context. Cc: <stable@vger.kernel.org> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/misc/ua101.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index 8b5d2c564e04..509315937f25 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -613,14 +613,24 @@ static int start_usb_playback(struct ua101 *ua)
613 613
614static void abort_alsa_capture(struct ua101 *ua) 614static void abort_alsa_capture(struct ua101 *ua)
615{ 615{
616 if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) 616 unsigned long flags;
617
618 if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) {
619 snd_pcm_stream_lock_irqsave(ua->capture.substream, flags);
617 snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN); 620 snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN);
621 snd_pcm_stream_unlock_irqrestore(ua->capture.substream, flags);
622 }
618} 623}
619 624
620static void abort_alsa_playback(struct ua101 *ua) 625static void abort_alsa_playback(struct ua101 *ua)
621{ 626{
622 if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) 627 unsigned long flags;
628
629 if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) {
630 snd_pcm_stream_lock_irqsave(ua->playback.substream, flags);
623 snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN); 631 snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN);
632 snd_pcm_stream_unlock_irqrestore(ua->playback.substream, flags);
633 }
624} 634}
625 635
626static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream, 636static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,