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-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a1f0a0e3d871e3d3e08a1429009992151becda8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 99c20f1b613a..34a513725c9e 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--; + } } }