From a061f57d662ac2b19a1ff1955349adce7a282a5d Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 23 May 2011 15:29:12 -0700 Subject: [PATCH] [SCSI] osst: wrong index used in inner loop Index i was already used in the outer loop. Fixes a potentially-infinite loop. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Roel Kluin Cc: Willem Riede Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- drivers/scsi/osst.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index 58f5be4740e..9b79e84f95b 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c @@ -4702,8 +4702,9 @@ static int __os_scsi_tape_open(struct inode * inode, struct file * filp) STp->partition = STp->new_partition = 0; if (STp->can_partitions) STp->nbr_partitions = 1; /* This guess will be updated later if necessary */ - for (i=0; i < ST_NBR_PARTITIONS; i++) { - STps = &(STp->ps[i]); + int j; + for (j = 0; j < ST_NBR_PARTITIONS; j++) { + STps = &(STp->ps[j]); STps->rw = ST_IDLE; STps->eof = ST_NOEOF; STps->at_sm = 0; -- 2.11.4.GIT