diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-03-12 01:09:47 +0300 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-03-12 12:03:42 +0300 |
commit | c12ec0a2d94001003dfb929ce14c287fca0522b0 (patch) | |
tree | fd901e7114ddc7e1c7905ad768b982b6ff17ef66 /drivers/block/paride/pt.c | |
parent | 39ad2bbb5900d1bc9ae8f06cebb4cb2529d9e42e (diff) | |
download | linux-c12ec0a2d94001003dfb929ce14c287fca0522b0.tar.xz |
paride: fix off-by-one test
With `while (j++ < PX_SPIN)' j reaches PX_SPIN + 1 after the loop. This
is probably unlikely to produce a problem.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/paride/pt.c')
-rw-r--r-- | drivers/block/paride/pt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 1e4006e18f03..bc5825fdeaab 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -274,11 +274,11 @@ static int pt_wait(struct pt_unit *tape, int go, int stop, char *fun, char *msg) && (j++ < PT_SPIN)) udelay(PT_SPIN_DEL); - if ((r & (STAT_ERR & stop)) || (j >= PT_SPIN)) { + if ((r & (STAT_ERR & stop)) || (j > PT_SPIN)) { s = read_reg(pi, 7); e = read_reg(pi, 1); p = read_reg(pi, 2); - if (j >= PT_SPIN) + if (j > PT_SPIN) e |= 0x100; if (fun) printk("%s: %s %s: alt=0x%x stat=0x%x err=0x%x" |