[SCSI] qla2xxx: Correct qla2x00_eh_wait_on_command() to wait correctly.
authorLalit Chandivade <lalit.chandivade@qlogic.com>
Tue, 25 Aug 2009 18:36:18 +0000 (11:36 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 12 Sep 2009 14:35:21 +0000 (09:35 -0500)
Original code would break-out of loop after only one iteration.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/qla2xxx/qla_os.c

index 649fd75d37b6a8b04e202569123d3b4bd1e79e82..ea9f91756c1e5d48b8b977eebe62f0a7fe39209b 100644 (file)
@@ -568,11 +568,8 @@ qla2x00_eh_wait_on_command(struct scsi_cmnd *cmd)
        unsigned long wait_iter = ABORT_WAIT_ITER;
        int ret = QLA_SUCCESS;
 
-       while (CMD_SP(cmd)) {
+       while (CMD_SP(cmd) && wait_iter--) {
                msleep(ABORT_POLLING_PERIOD);
-
-               if (--wait_iter)
-                       break;
        }
        if (CMD_SP(cmd))
                ret = QLA_FUNCTION_FAILED;