diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-07-07 15:07:53 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-07-08 15:50:36 +0300 |
commit | 0ebf3ceb83648f9d149220bf0c6986ddce11361a (patch) | |
tree | 2b2e691822fcb540eb9554126947ff82385d035d | |
parent | 3c53c6255d598db7084c5c3d7553d7200e857818 (diff) | |
download | linux-0ebf3ceb83648f9d149220bf0c6986ddce11361a.tar.xz |
ALSA: firewire-lib: fix invalid length of rx packet payload for tracepoint events
Although CIP header is handled as context header, the length of isochronous
packet includes two quadlets for its payload. In tracepoints event the
value of payload_quadlets should includes the two quadlets. But at present
it doesn't.
This commit fixes the bug.
Fixes: b18f0cfaf16b ("ALSA: firewire-lib: use 8 byte packet header for IT context to separate CIP header from CIP payload")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/firewire/amdtp-stream.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 87a46bd60496..427624009de9 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -490,8 +490,12 @@ static void build_it_pkt_header(struct amdtp_stream *s, unsigned int cycle, unsigned int data_blocks, unsigned int syt, unsigned int index) { + unsigned int payload_length; __be32 *cip_header; + payload_length = data_blocks * sizeof(__be32) * s->data_block_quadlets; + params->payload_length = payload_length; + if (s->flags & CIP_DBC_IS_END_EVENT) { s->data_block_counter = (s->data_block_counter + data_blocks) & 0xff; @@ -501,6 +505,7 @@ static void build_it_pkt_header(struct amdtp_stream *s, unsigned int cycle, cip_header = (__be32 *)params->header; generate_cip_header(s, cip_header, syt); params->header_length = 2 * sizeof(__be32); + payload_length += params->header_length; } else { cip_header = NULL; } @@ -510,11 +515,8 @@ static void build_it_pkt_header(struct amdtp_stream *s, unsigned int cycle, (s->data_block_counter + data_blocks) & 0xff; } - params->payload_length = - data_blocks * sizeof(__be32) * s->data_block_quadlets; - - trace_amdtp_packet(s, cycle, cip_header, params->payload_length, - data_blocks, index); + trace_amdtp_packet(s, cycle, cip_header, payload_length, data_blocks, + index); } static int check_cip_header(struct amdtp_stream *s, const __be32 *buf, |