فهرست منبع

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 <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
roel kluin 15 سال پیش
والد
کامیت
d2a928e4bf
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/net/niu.c

+ 1 - 1
drivers/net/niu.c

@@ -2844,7 +2844,7 @@ static int tcam_wait_bit(struct niu *np, u64 bit)
 			break;
 			break;
 		udelay(1);
 		udelay(1);
 	}
 	}
-	if (limit < 0)
+	if (limit <= 0)
 		return -ENODEV;
 		return -ENODEV;
 
 
 	return 0;
 	return 0;