netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Test off by one in sh_eth_reset()
@ 2009-12-30 11:43 Roel Kluin
  2010-01-04  5:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-12-30 11:43 UTC (permalink / raw)
  To: netdev, Andrew Morton, LKML, David S. Miller

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 drivers/net/sh_eth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index ca62850..7402b85 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 */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: Test off by one in sh_eth_reset()
  2009-12-30 11:43 [PATCH] net: Test off by one in sh_eth_reset() Roel Kluin
@ 2010-01-04  5:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-01-04  5:43 UTC (permalink / raw)
  To: roel.kluin; +Cc: netdev, akpm, linux-kernel

From: Roel Kluin <roel.kluin@gmail.com>
Date: Wed, 30 Dec 2009 12:43:45 +0100

> If no break occurred, cnt reaches 0 after the loop.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-04  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30 11:43 [PATCH] net: Test off by one in sh_eth_reset() Roel Kluin
2010-01-04  5:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).