Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: line6: fix playback urb transfer buffer calculation

The playback urb transfer buffer calculation does not factor in
LINE6_ISO_PACKETS. Buffer memory is organized like this in the driver:

Buffer 0 Buffer 1 ...
[Packet 0, Packet 1, ...][Packet 0, Packet 1, ...][Packet 0, ...]

However, we're lucky that LINE6_ISO_PACKETS is currently defined as 1 so
this patch does not change any behavior. It's still worth including
this fix in case the LINE6_ISO_PACKETS value is changed in the future.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Stefan Hajnoczi and committed by
Greg Kroah-Hartman
2f637ee4 60c01a97

+1 -1
+1 -1
drivers/staging/line6/playback.c
··· 192 192 urb_frames = urb_size / bytes_per_frame; 193 193 urb_out->transfer_buffer = 194 194 line6pcm->buffer_out + 195 - line6pcm->max_packet_size * line6pcm->index_out; 195 + LINE6_ISO_PACKETS * line6pcm->max_packet_size * line6pcm->index_out; 196 196 urb_out->transfer_buffer_length = urb_size; 197 197 urb_out->context = line6pcm; 198 198