[SCSI] qla2xxx: fix timeout in qla2x00_down_timeout
authorBill Nottingham <notting@redhat.com>
Wed, 30 May 2007 08:16:43 +0000 (04:16 -0400)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Wed, 30 May 2007 15:15:32 +0000 (10:15 -0500)
iterations is unsigned, so it is impossible to get out of the loop
and return -ETIMEDOUT.

Signed-off-by: Bill Nottingham <notting@redhat.com>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/qla2xxx/qla_os.c

index dd076da..b98136a 100644 (file)
@@ -2590,7 +2590,7 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
                        return 0;
                if (msleep_interruptible(step))
                        break;
-       } while (--iterations >= 0);
+       } while (--iterations > 0);
 
        return -ETIMEDOUT;
 }