diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-27 16:17:26 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-28 07:22:30 +0100 |
commit | f2bb614bb6c7f5245521195f144272ef93d9f086 (patch) | |
tree | 2e491dc66f9805f1872e2c7a141dc38da30f4d81 /sound/usb/line6/playback.c | |
parent | 3d3ae4454deb94bbad9ad0b2b559cbf6c0db4ec2 (diff) | |
download | linux-stable-f2bb614bb6c7f5245521195f144272ef93d9f086.tar.gz linux-stable-f2bb614bb6c7f5245521195f144272ef93d9f086.tar.bz2 linux-stable-f2bb614bb6c7f5245521195f144272ef93d9f086.zip |
ALSA: line6: Clear prev_fbuf and prev_fsize properly
Clearing prev_fsize in line6_pcm_acquire() is pretty racy.
This can be called at any time while the stream is being played.
Rather better to clear prev_fbuf and prev_fsize at the proper place
like the stream stop for capture, and just after copying the monitor /
impulse data inside the spinlock.
Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/line6/playback.c')
-rw-r--r-- | sound/usb/line6/playback.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c index b4a26d0c8267..242265929145 100644 --- a/sound/usb/line6/playback.c +++ b/sound/usb/line6/playback.c @@ -166,9 +166,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) struct usb_iso_packet_descriptor *fout = &urb_out->iso_frame_desc[i]; - if (line6pcm->flags & LINE6_BITS_CAPTURE_STREAM) - fsize = line6pcm->prev_fsize; - + fsize = line6pcm->prev_fsize; if (fsize == 0) { int n; @@ -263,6 +261,8 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm) line6pcm->volume_monitor, bytes_per_frame); } + line6pcm->prev_fbuf = NULL; + line6pcm->prev_fsize = 0; } spin_unlock(&line6pcm->in.lock); |