From: Roel Kluin <12o3l@tiscali.nl> Date: Mon, 5 Nov 2007 22:55:02 +0000 (+0100) Subject: ipw2100: fix postfix decrement errors X-Git-Tag: v2.6.24-rc3~163^2~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2a1c3eb4029aa7f17533fe7e9a917a7b3349644;p=linux-2.6 ipw2100: fix postfix decrement errors If i reaches zero, the loop ends, but the postfix decrement subtracts it to -1. Testing for 'i == 0', later in the function, will not fulfill its purpose. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8d53d08b96..fc6cdd8086 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c @@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) IPW2100_INTA_FATAL_ERROR | IPW2100_INTA_PARITY_ERROR); } - } while (i--); + } while (--i); /* Clear out any pending INTAs since we aren't supposed to have * interrupts enabled at this point... */ @@ -1339,7 +1339,7 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv) if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) break; - } while (i--); + } while (--i); priv->status &= ~STATUS_RESET_PENDING;