bcm63xx_enet: timeout off by one in do_mdio_op()
authorroel kluin <roel.kluin@gmail.com>
Mon, 21 Sep 2009 10:08:48 +0000 (10:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Oct 2009 03:03:15 +0000 (20:03 -0700)
`while (limit-- >= 0)' reaches -2 after the loop upon timeout.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bcm63xx_enet.c

index 09d2709..ba29dc3 100644 (file)
@@ -90,7 +90,7 @@ static int do_mdio_op(struct bcm_enet_priv *priv, unsigned int data)
                if (enet_readl(priv, ENET_IR_REG) & ENET_IR_MII)
                        break;
                udelay(1);
-       } while (limit-- >= 0);
+       } while (limit-- > 0);
 
        return (limit < 0) ? 1 : 0;
 }