Skip to contentSkip to conversation

hisax: timeout off by one in waitrecmsg()

PATCH Applied [email protected] 2 participants 2 messages Feb 2, 2010 – Feb 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 hisax: timeout off by one in waitrecmsg()

From: Roel Kluin <[email protected]>

With `while (timeout++ < maxdelay)' timeout reaches maxdelay + 1 after the loop This is probably unlikely a problem in practice.

---

 drivers/isdn/hisax/isar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/isdn/hisax/isar.c renamed from drivers/isdn/hisax/isar.c~hisax-timeout-off-by-one-in-waitrecmsg +1 -1
diff -puN drivers/isdn/hisax/isar.c~hisax-timeout-off-by-one-in-waitrecmsg drivers/isdn/hisax/isar.c
@@ -138,7 +138,7 @@ waitrecmsg(struct IsdnCardState *cs, u_c
 	while((!(cs->BC_Read_Reg(cs, 0, ISAR_IRQBIT) & ISAR_IRQSTA)) &&
 		(timeout++ < maxdelay))
 		udelay(1);
-	if (timeout >= maxdelay) {
+	if (timeout > maxdelay) {
 		printk(KERN_WARNING"isar recmsg IRQSTA timeout\n");
 		return(0);
 	}

_