diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2010-03-11 14:09:47 -0800 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-03-12 10:03:42 +0100 |
commit | c12ec0a2d94001003dfb929ce14c287fca0522b0 (patch) | |
tree | fd901e7114ddc7e1c7905ad768b982b6ff17ef66 /drivers/block/paride/pf.c | |
parent | 39ad2bbb5900d1bc9ae8f06cebb4cb2529d9e42e (diff) |
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/pf.c')
-rw-r--r-- | drivers/block/paride/pf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index ddb4f9abd48..c059aab3006 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -391,11 +391,11 @@ static int pf_wait(struct pf_unit *pf, int go, int stop, char *fun, char *msg) && (j++ < PF_SPIN)) udelay(PF_SPIN_DEL); - if ((r & (STAT_ERR & stop)) || (j >= PF_SPIN)) { + if ((r & (STAT_ERR & stop)) || (j > PF_SPIN)) { s = read_reg(pf, 7); e = read_reg(pf, 1); p = read_reg(pf, 2); - if (j >= PF_SPIN) + if (j > PF_SPIN) e |= 0x100; if (fun) printk("%s: %s %s: alt=0x%x stat=0x%x err=0x%x" |