Przeglądaj źródła

net: Test off by one in sh_eth_reset()

If no break occurred, cnt reaches 0 after the loop.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
roel kluin 15 lat temu
rodzic
commit
890c8c1898
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      drivers/net/sh_eth.c

+ 1 - 1
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 */