[alsa-devel] [PATCH 1/5] ALSA: line6: Fix racy loopback handling
Chris Rorvick
chris at rorvick.com
Wed Jan 28 06:41:03 CET 2015
On Tue, Jan 27, 2015 at 10:13 AM, Takashi Iwai <tiwai at suse.de> wrote:
> /* open capture callback */
> diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c
> index 3762a98026aa..b1d376501616 100644
> --- a/sound/usb/line6/playback.c
> +++ b/sound/usb/line6/playback.c
> @@ -284,15 +282,18 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
> */
> int line6_submit_audio_out_all_urbs(struct snd_line6_pcm *line6pcm)
> {
> - int ret, i;
> + unsigned long flags;
> + int ret = 0, i;
>
> + spin_lock_irqsave(&line6pcm->out.lock, flags);
> for (i = 0; i < LINE6_ISO_BUFFERS; ++i) {
> ret = submit_audio_out_urb(line6pcm);
> if (ret < 0)
> - return ret;
> + break;
> }
>
> - return 0;
> + spin_unlock_irqrestore(&line6pcm->in.lock, flags);
> + return ret;
s/in.lock/out.lock/
More information about the Alsa-devel
mailing list