diff mbox

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

Message ID 201002022243.o12MhiOo019211@imap1.linux-foundation.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Andrew Morton Feb. 2, 2010, 10:43 p.m. UTC
From: Roel Kluin <roel.kluin@gmail.com>

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/isdn/hisax/isar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Feb. 4, 2010, 4:17 a.m. UTC | #1
From: akpm@linux-foundation.org
Date: Tue, 02 Feb 2010 14:43:44 -0800

> From: Roel Kluin <roel.kluin@gmail.com>
> 
> With `while (timeout++ < maxdelay)' timeout reaches maxdelay + 1 after the
> loop This is probably unlikely a problem in practice.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -puN drivers/isdn/hisax/isar.c~hisax-timeout-off-by-one-in-waitrecmsg drivers/isdn/hisax/isar.c
--- a/drivers/isdn/hisax/isar.c~hisax-timeout-off-by-one-in-waitrecmsg
+++ a/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);
 	}