From: roel kluin Date: Wed, 30 Dec 2009 01:43:45 +0000 (+0000) Subject: net: Test off by one in sh_eth_reset() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=890c8c18986eb975a76aa8359a712596bc70e61c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: Test off by one in sh_eth_reset() If no break occurred, cnt reaches 0 after the loop. Signed-off-by: Roel Kluin Signed-off-by: David S. Miller --- diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index ca6285016dfd..7402b858cab7 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -110,7 +110,7 @@ static void sh_eth_reset(struct net_device *ndev) mdelay(1); cnt--; } - if (cnt < 0) + if (cnt == 0) printk(KERN_ERR "Device reset fail\n"); /* Table Init */