lkml.org 
[lkml]   [2011]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] osst: wrong index used in inner loop
Index i was already used in the outer loop.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
drivers/scsi/osst.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

I'm not sure if this is the right fix, maybe a break or return
is missing?

diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 521e218..d6d6d89 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;

\
 
 \ /
  Last update: 2011-03-19 20:57    [W:0.046 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site