public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: qla2xxx-upstream@qlogic.com,
	Atul Deshmukh <atul.deshmukh@qlogic.com>,
	"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: Re: [patch] qla2xxx: fix a timeout loop
Date: Wed, 16 Dec 2015 11:45:42 +0000	[thread overview]
Message-ID: <20151216114542.GF31151@c203.arch.suse.de> (raw)
In-Reply-To: <20151216110746.GB21018@mwanda>

On Wed, Dec 16, 2015 at 02:07:46PM +0300, Dan Carpenter wrote:
> 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) {
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Good catch.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 11:07 [patch] qla2xxx: fix a timeout loop Dan Carpenter
2015-12-16 11:45 ` Johannes Thumshirn [this message]
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=20151216114542.GF31151@c203.arch.suse.de \
    --to=jthumshirn@suse.de \
    --cc=JBottomley@odin.com \
    --cc=atul.deshmukh@qlogic.com \
    --cc=dan.carpenter@oracle.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