public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] qla2xxx: fix a timeout loop
@ 2015-12-16 11:07 Dan Carpenter
  2015-12-16 11:45 ` Johannes Thumshirn
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Carpenter @ 2015-12-16 11:07 UTC (permalink / raw)
  To: qla2xxx-upstream, Atul Deshmukh
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	kernel-janitors

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) {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-17 16:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-16 11:07 [patch] qla2xxx: fix a timeout loop Dan Carpenter
2015-12-16 11:45 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox