From: Roel Kluin Date: Tue, 2 Feb 2010 12:43:44 +0000 (+0000) Subject: hisax: timeout off by one in waitrecmsg() X-Git-Tag: firefly_0821_release~9833^2~3055^2~436 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e23e11792a77c7d54f363841cd5e33074fb0c8c9;p=firefly-linux-kernel-4.4.55.git hisax: timeout off by one in waitrecmsg() With `while (timeout++ < maxdelay)' timeout reaches maxdelay + 1 after the loop This is probably unlikely a problem in practice. Signed-off-by: Roel Kluin Cc: Karsten Keil Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index bfeb9b6aa043..6bde16c00fb5 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -138,7 +138,7 @@ waitrecmsg(struct IsdnCardState *cs, u_char *len, 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); }