diff options
author | john.maxin@nokia.com <john.maxin@nokia.com> | 2011-05-06 05:17:21 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:01:38 -0400 |
commit | eff3bba61fc19a64a1ca56343e38b6506bef9dea (patch) | |
tree | 10f2c7cabc65d4385cedc76ee95b0eb7ad279cf0 /drivers/mtd/onenand | |
parent | 26d9be11485ea8c1102c3e8eaa7667412eef4950 (diff) |
mtd: onenand: add missing check
Coverity has reported that inside the function "onenand_block_by_block_erase()"
in onenand_base.c, we should add a check to prevent the incrementing of
possible NULL value for "region"
Signed-off-by: Maxin B. John <john.maxin@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index d27f93b354e8..289ee3b1b030 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -2453,7 +2453,7 @@ static int onenand_block_by_block_erase(struct mtd_info *mtd, | |||
2453 | len -= block_size; | 2453 | len -= block_size; |
2454 | addr += block_size; | 2454 | addr += block_size; |
2455 | 2455 | ||
2456 | if (addr == region_end) { | 2456 | if (region && addr == region_end) { |
2457 | if (!len) | 2457 | if (!len) |
2458 | break; | 2458 | break; |
2459 | region++; | 2459 | region++; |