From: Roel Kluin <12o3l@tiscali.nl>
To: netdev@vger.kernel.org
Subject: [PATCH] postfix decrement error in smc911x_reset(); drivers/net/smc911x.c
Date: Mon, 05 Nov 2007 00:45:53 +0100 [thread overview]
Message-ID: <472E59B1.80206@tiscali.nl> (raw)
If timeout causes the loop to end, a postfix decrement causes its value to
become 4294967295 (unsigned int), not 0.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index dd18af0..41f3c8f 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -243,7 +243,7 @@ static void smc911x_reset(struct net_device *dev)
do {
udelay(10);
reg = SMC_GET_PMT_CTRL() & PMT_CTRL_READY_;
- } while ( timeout-- && !reg);
+ } while ( --timeout && !reg);
if (timeout == 0) {
PRINTK("%s: smc911x_reset timeout waiting for PM restore\n", dev->name);
return;
next reply other threads:[~2007-11-04 23:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-04 23:45 Roel Kluin [this message]
2007-11-04 23:49 ` [PATCH] postfix decrement error in smc911x_reset(); drivers/net/smc911x.c Roel Kluin
2007-11-04 23:59 ` Roel Kluin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=472E59B1.80206@tiscali.nl \
--to=12o3l@tiscali.nl \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.