From: Lalit Chandivade Date: Tue, 25 Aug 2009 18:36:18 +0000 (-0700) Subject: [SCSI] qla2xxx: Correct qla2x00_eh_wait_on_command() to wait correctly. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d970432c48ab8dd28216e80942723aeb505b623e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SCSI] qla2xxx: Correct qla2x00_eh_wait_on_command() to wait correctly. Original code would break-out of loop after only one iteration. Signed-off-by: Lalit Chandivade Signed-off-by: Andrew Vasquez Signed-off-by: Giridhar Malavali Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 649fd75d37b6..ea9f91756c1e 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -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;