diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-12-15 11:03:19 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-12-16 10:10:18 +0100 |
commit | ada79fa5a0b374dd2c2262137c734da7524a8263 (patch) | |
tree | b603eabf4f35b31dcea37649905e1e0297962ee1 /sound/firewire | |
parent | Merge branch 'topic/huawei-leds' into for-next (diff) | |
download | linux-ada79fa5a0b374dd2c2262137c734da7524a8263.tar.xz linux-ada79fa5a0b374dd2c2262137c734da7524a8263.zip |
ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet
In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a
second argument for 'the number of bytes in payload of isochronous
packet'. However, an incoming packet handler without CIP header uses the
value as 'the number of quadlets in the payload'. This brings userspace
applications to receive the number of PCM frames as four times against
real time.
This commit fixes the bug.
Cc: <stable@vger.kernel.org> # v4.12+
Fixes: 3b196c394dd ('ALSA: firewire-lib: add no-header packet processing')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r-- | sound/firewire/amdtp-stream.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 9be76c808fcc..3ada55ed5381 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -654,15 +654,17 @@ end: } static int handle_in_packet_without_header(struct amdtp_stream *s, - unsigned int payload_quadlets, unsigned int cycle, + unsigned int payload_length, unsigned int cycle, unsigned int index) { __be32 *buffer; + unsigned int payload_quadlets; unsigned int data_blocks; struct snd_pcm_substream *pcm; unsigned int pcm_frames; buffer = s->buffer.packets[s->packet_index].buffer; + payload_quadlets = payload_length / 4; data_blocks = payload_quadlets / s->data_block_quadlets; trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks, |