Skip to content

Commit 22df6ff

Browse files
takaswiegregkh
authored andcommitted
ALSA: firewire-lib: fix to check cycle continuity
commit 77ce965 upstream. The local helper function to compare the given pair of cycle count evaluates them. If the left value is less than the right value, the function returns negative value. If the safe cycle is less than the current cycle, it is the case of cycle lost. However, it is not currently handled properly. This commit fixes the bug. Cc: <stable@vger.kernel.org> Fixes: 705794c ("ALSA: firewire-lib: check cycle continuity") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20240218033026.72577-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2caa605 commit 22df6ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/firewire/amdtp-stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ static int generate_tx_packet_descs(struct amdtp_stream *s, struct pkt_desc *des
951951
// to the reason.
952952
unsigned int safe_cycle = increment_ohci_cycle_count(next_cycle,
953953
IR_JUMBO_PAYLOAD_MAX_SKIP_CYCLES);
954-
lost = (compare_ohci_cycle_count(safe_cycle, cycle) > 0);
954+
lost = (compare_ohci_cycle_count(safe_cycle, cycle) < 0);
955955
}
956956
if (lost) {
957957
dev_err(&s->unit->device, "Detect discontinuity of cycle: %d %d\n",

0 commit comments

Comments
 (0)