Skip to content

Commit

Permalink
firewire: core: fix retries calculation in iso manage_channel()
Browse files Browse the repository at this point in the history
If there is a permanent error condition when communicating with the IRM,
after the sixth error, the retry variable will be decremented to -1.
If, in this case, the bits in channels_mask are not yet exhausted, the
next channel is retried 2^32 times.

To fix this, check that retry is never decremented beyond zero.

Signed-off-by: Clemens Ladisch <[email protected]>
Signed-off-by: Stefan Richter <[email protected]>
  • Loading branch information
cladisch authored and Stefan Richter committed Apr 19, 2010
1 parent a2612cb commit 3a1f0a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/firewire/core-iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,

/* 1394-1995 IRM, fall through to retry. */
default:
if (retry--)
if (retry) {
retry--;
i--;
}
}
}

Expand Down

0 comments on commit 3a1f0a0

Please sign in to comment.