From: Clemens Ladisch Date: Mon, 12 Apr 2010 08:35:05 +0000 (+0200) Subject: firewire: core: fix retries calculation in iso manage_channel() X-Git-Tag: v2.6.34-rc6~64^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a1f0a0e3d871e3d3e08a1429009992151becda8;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 --- diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 99c20f1..34a5137 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -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--; + } } }