ALSA: firewire-lib: fix data block counter for incoming packet without CIP header
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 24 May 2019 09:03:39 +0000 (18:03 +0900)
committerTakashi Iwai <tiwai@suse.de>
Fri, 24 May 2019 09:18:01 +0000 (11:18 +0200)
The value of data block counter is not calculated for incoming packet
without CIP header. This commit fixes the bug.

Fixes: 947b437e1263 ("ALSA: firewire-lib: unify packet handler for IR context")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/amdtp-stream.c

index 791efa5585c2a051638844e3c7c75d1fe6dbc826..8a7da86650ea3fd7c3c30d7b088f9b2fc9d1c782 100644 (file)
@@ -674,6 +674,8 @@ static int handle_in_packet(struct amdtp_stream *s, unsigned int cycle,
                cip_header = NULL;
                data_blocks = payload_length / 4 / s->data_block_quadlets;
                syt = 0;
+               s->data_block_counter =
+                               (s->data_block_counter + data_blocks) & 0xff;
        }
 
        trace_amdtp_packet(s, cycle, cip_header, payload_length, data_blocks,