Skip to content

Commit

Permalink
[SCSI] osst: wrong index used in inner loop
Browse files Browse the repository at this point in the history
Index i was already used in the outer loop.  Fixes a potentially-infinite
loop.

[[email protected]: coding-style fixes]
Signed-off-by: Roel Kluin <[email protected]>
Cc: Willem Riede <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
RoelKluin authored and James Bottomley committed May 24, 2011
1 parent 8e91096 commit a061f57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/scsi/osst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a061f57

Please sign in to comment.