mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bill Nottingham <notting@redhat.com>
To: linux-scsi@vger.kernel.org
Cc: linux-driver@qlogic.com, linux-kernel@vger.kernel.org
Subject: [PATCH RFC] qla2xxx: fix timeout in qla2x00_down_timeout
Date: Wed, 30 May 2007 04:16:43 -0400	[thread overview]
Message-ID: <20070530081643.GA29004@nostromo.devel.redhat.com> (raw)

iterations is unsigned, so it is impossible to get out of the loop
and return -ETIMEDOUT.

Signed-off-by: Bill Nottingham <notting@redhat.com>

---

If the intention *is* to never fall out of the end of the loop, ignore
this, and just replace it with do {} while (1);.

--- drivers/scsi/qla2xxx/qla_os.c.foo	2007-05-30 04:07:52.000000000 -0400
+++ drivers/scsi/qla2xxx/qla_os.c	2007-05-30 04:08:31.000000000 -0400
@@ -2587,15 +2587,15 @@ qla2x00_down_timeout(struct semaphore *s
 	unsigned int iterations = jiffies_to_msecs(timeout)/100;
 
 	do {
 		if (!down_trylock(sema))
 			return 0;
 		if (msleep_interruptible(step))
 			break;
-	} while (--iterations >= 0);
+	} while (--iterations > 0);
 
 	return -ETIMEDOUT;
 }
 
 /* Firmware interface routines. */
 
 #define FW_BLOBS	5

             reply	other threads:[~2007-05-30  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-30  8:16 Bill Nottingham [this message]
2007-05-30 11:25 ` Seokmann Ju

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=20070530081643.GA29004@nostromo.devel.redhat.com \
    --to=notting@redhat.com \
    --cc=linux-driver@qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®