summaryrefslogtreecommitdiff
path: root/drivers/net/jme.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-03-04 00:11:42 -0800
committerDavid S. Miller <davem@davemloft.net>2009-03-04 00:11:42 -0800
commit858b9ced6e73a0f087294c398a1ae70a7eeed94f (patch)
tree81a2298b2c45d90f68b016fb0b4fa05c19a787f5 /drivers/net/jme.c
parent4222474519ff5b31a526dfa1da7aa4b0e38bef5c (diff)
downloadlinux-3.10-858b9ced6e73a0f087294c398a1ae70a7eeed94f.tar.gz
linux-3.10-858b9ced6e73a0f087294c398a1ae70a7eeed94f.tar.bz2
linux-3.10-858b9ced6e73a0f087294c398a1ae70a7eeed94f.zip
net: more timeouts that reach -1
with while (timeout-- > 0); timeout reaches -1 after the loop, so the tests below are off by one. also don't do an '< 0' test on an unsigned. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jme.c')
-rw-r--r--drivers/net/jme.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 08b34051c64..a6e1a35a13c 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -957,13 +957,14 @@ jme_process_receive(struct jme_adapter *jme, int limit)
goto out_inc;
i = atomic_read(&rxring->next_to_clean);
- while (limit-- > 0) {
+ while (limit > 0) {
rxdesc = rxring->desc;
rxdesc += i;
if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) ||
!(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL))
goto out;
+ --limit;
desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT;