Skip to content

Commit

Permalink
mtd: onenand: add missing check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
john.maxin@nokia.com authored and David Woodhouse committed May 25, 2011
1 parent 26d9be1 commit eff3bba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,7 @@ static int onenand_block_by_block_erase(struct mtd_info *mtd,
len -= block_size;
addr += block_size;

if (addr == region_end) {
if (region && addr == region_end) {
if (!len)
break;
region++;
Expand Down

0 comments on commit eff3bba

Please sign in to comment.