From: roel kluin Date: Sun, 27 Dec 2009 04:10:59 +0000 (+0000) Subject: niu: timeout ignored in tcam_wait_bit() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=d2a928e4bfc75170af641f073475fc974cf176c2;p=deliverable%2Flinux.git niu: timeout ignored in tcam_wait_bit() With `while (--limit > 0)' i reaches 0 after the loop, so upon timeout the error was not returned. Signed-off-by: Roel Kluin Signed-off-by: David S. Miller --- diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 8ce58c4c7dd3..2aed2b382c40 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -2844,7 +2844,7 @@ static int tcam_wait_bit(struct niu *np, u64 bit) break; udelay(1); } - if (limit < 0) + if (limit <= 0) return -ENODEV; return 0;