aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2011-05-23 18:29:12 -0400
committerJames Bottomley <jbottomley@parallels.com>2011-05-24 13:08:57 -0400
commita061f57d662ac2b19a1ff1955349adce7a282a5d (patch)
tree60645af34a8a24dfb5b6c256f65a537afa85715a
parent8e910965975a125fff806acae80ab2b640a8dac7 (diff)
[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 <roel.kluin@gmail.com> Cc: Willem Riede <osst@riede.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <jbottomley@parallels.com>
-rw-r--r--drivers/scsi/osst.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 58f5be4740e9..9b79e84f95bb 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)
4702 STp->partition = STp->new_partition = 0; 4702 STp->partition = STp->new_partition = 0;
4703 if (STp->can_partitions) 4703 if (STp->can_partitions)
4704 STp->nbr_partitions = 1; /* This guess will be updated later if necessary */ 4704 STp->nbr_partitions = 1; /* This guess will be updated later if necessary */
4705 for (i=0; i < ST_NBR_PARTITIONS; i++) { 4705 int j;
4706 STps = &(STp->ps[i]); 4706 for (j = 0; j < ST_NBR_PARTITIONS; j++) {
4707 STps = &(STp->ps[j]);
4707 STps->rw = ST_IDLE; 4708 STps->rw = ST_IDLE;
4708 STps->eof = ST_NOEOF; 4709 STps->eof = ST_NOEOF;
4709 STps->at_sm = 0; 4710 STps->at_sm = 0;