Date: Mon, 12 Apr 2010 10:35:05 +0200 From: Clemens Ladisch Subject: firewire: core: fix retries calculation in iso manage_channel() 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 Signed-off-by: Stefan Richter --- drivers/firewire/core-iso.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: b/drivers/firewire/core-iso.c =================================================================== --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -251,8 +251,10 @@ static int manage_channel(struct fw_card /* 1394-1995 IRM, fall through to retry. */ default: - if (retry--) + if (retry) { + retry--; i--; + } } }