diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-10-21 12:08:35 +0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-11-06 00:19:21 +0300 |
commit | e8e6c875658c39624fc8cb4c6f3e1b6ab9ce1b6e (patch) | |
tree | 3b0ec78a86b12a02755d091ce29b2ca08079931a /drivers/mtd/inftlmount.c | |
parent | f02985b78550f5ee9d8d0603b21fd7d98ca58c1c (diff) | |
download | linux-e8e6c875658c39624fc8cb4c6f3e1b6ab9ce1b6e.tar.xz |
mtd: intflmount: fix off by one error in INFTL_dumpVUchains()
The ->PUtable[] array has "->nb_blocks" number of elemetns so this
comparison should be ">=" instead of ">". Otherwise it could result in
a minor read beyond the end of an array.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/inftlmount.c')
-rw-r--r-- | drivers/mtd/inftlmount.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c index 487e64f411a5..1388c8d7f309 100644 --- a/drivers/mtd/inftlmount.c +++ b/drivers/mtd/inftlmount.c @@ -518,7 +518,7 @@ void INFTL_dumpVUchains(struct INFTLrecord *s) pr_debug("INFTL Virtual Unit Chains:\n"); for (logical = 0; logical < s->nb_blocks; logical++) { block = s->VUtable[logical]; - if (block > s->nb_blocks) + if (block >= s->nb_blocks) continue; pr_debug(" LOGICAL %d --> %d ", logical, block); for (i = 0; i < s->nb_blocks; i++) { |