public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: qla2xxx-upstream@qlogic.com, Atul Deshmukh <atul.deshmukh@qlogic.com>
Cc: "James E.J. Bottomley" <JBottomley@odin.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] qla2xxx: fix a timeout loop
Date: Wed, 16 Dec 2015 11:07:46 +0000	[thread overview]
Message-ID: <20151216110746.GB21018@mwanda> (raw)

After the loop we test for "if (!retries) " as a failure, but actually
the post-op here will end with retries set to -1.  I have fixed this by
using a pre-op instead.

Fixes: 7ec0effd30bb ('[SCSI] qla2xxx: Add support for ISP8044.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c
index 007192d..66d629e 100644
--- a/drivers/scsi/qla2xxx/qla_nx2.c
+++ b/drivers/scsi/qla2xxx/qla_nx2.c
@@ -3491,7 +3491,7 @@ qla8044_poll_flash_status_reg(struct scsi_qla_host *vha)
 	int retries = QLA8044_FLASH_READ_RETRY_COUNT;
 	int ret_val = QLA_SUCCESS;
 
-	while (retries--) {
+	while (--retries) {
 		ret_val = qla8044_rd_reg_indirect(vha, QLA8044_FLASH_STATUS,
 		    &flash_status);
 		if (ret_val) {

             reply	other threads:[~2015-12-16 11:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 11:07 Dan Carpenter [this message]
2015-12-16 11:45 ` [patch] qla2xxx: fix a timeout loop Johannes Thumshirn
2015-12-16 22:50 ` Martin K. Petersen
2015-12-17 10:46   ` Dan Carpenter
2015-12-17 16:47     ` Martin K. Petersen
2015-12-17  1:25 ` Himanshu Madhani

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=20151216110746.GB21018@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=JBottomley@odin.com \
    --cc=atul.deshmukh@qlogic.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qla2xxx-upstream@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