From: Takashi Iwai Date: Thu, 11 Jul 2013 15:58:25 +0000 (+0200) Subject: ALSA: ua101: Fix unlocked snd_pcm_stop() call X-Git-Tag: v3.11-rc4~4^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9538aa46c2427d6782aa10036c4da4c541605e0e;p=platform%2Fkernel%2Flinux-exynos.git ALSA: ua101: Fix unlocked snd_pcm_stop() call snd_pcm_stop() must be called in the PCM substream lock context. Cc: Acked-by: Clemens Ladisch Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 8b5d2c5..5093159 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) static void abort_alsa_capture(struct ua101 *ua) { - if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) + unsigned long flags; + + if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) { + snd_pcm_stream_lock_irqsave(ua->capture.substream, flags); snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stream_unlock_irqrestore(ua->capture.substream, flags); + } } static void abort_alsa_playback(struct ua101 *ua) { - if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) + unsigned long flags; + + if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) { + snd_pcm_stream_lock_irqsave(ua->playback.substream, flags); snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN); + snd_pcm_stream_unlock_irqrestore(ua->playback.substream, flags); + } } static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,