From: Giel van Schijndel <me@mortis.eu>
To: linux-kernel@vger.kernel.org
Cc: Giel van Schijndel <me@mortis.eu>,
Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>,
Ron Mercer <ron.mercer@qlogic.com>,
linux-driver@qlogic.com (supporter:QLOGIC QLA3XXX NE...),
netdev@vger.kernel.org (open list:QLOGIC QLA3XXX NE...)
Subject: [PATCH] Fix an infinite retry-loop
Date: Sun, 4 Jan 2015 19:04:55 +0100 [thread overview]
Message-ID: <1420394696-20099-1-git-send-email-me@mortis.eu> (raw)
This was clearly intended as a retry-10-times loop, but due to the
absence of code incrementing the loop-counter it was practically a
retry-forever loop.
Rewritten it as a for-loop as well to make the loop-counter increment
(as well as its potential absence) easier to spot.
---
drivers/net/ethernet/qlogic/qla3xxx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index c2f09af..35a26c9 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -144,9 +144,9 @@ static int ql_sem_lock(struct ql3_adapter *qdev, u32 sem_mask, u32 sem_bits)
*/
static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev)
{
- int i = 0;
+ int i;
- while (i < 10) {
+ for (i = 0; i < 10; ++i) {
if (i)
ssleep(1);
--
2.1.4
next reply other threads:[~2015-01-04 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-04 18:04 Giel van Schijndel [this message]
2015-01-04 23:04 ` [PATCH] Fix an infinite retry-loop Giel van Schijndel
2015-01-05 4:48 ` David Miller
2015-01-07 18:39 ` Andy Shevchenko
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=1420394696-20099-1-git-send-email-me@mortis.eu \
--to=me@mortis.eu \
--cc=jitendra.kalsaria@qlogic.com \
--cc=linux-driver@qlogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ron.mercer@qlogic.com \
/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 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).