Skip to content

Commit

Permalink
mtd: pxa3xx_nand: initialiaze pxa3xx_flash_ids to 0
Browse files Browse the repository at this point in the history
pxa3xx_flash_ids wasn't initialized to 0, which in certain cases could
end up containing corrupted values in its members. Fix this to avoid
possible issues.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Antoine Ténart authored and Brian Norris committed Feb 28, 2015
1 parent ed446cc commit 7c2f717
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mtd/nand/pxa3xx_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,8 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
return ret;
}

memset(pxa3xx_flash_ids, 0, sizeof(pxa3xx_flash_ids));

pxa3xx_flash_ids[0].name = f->name;
pxa3xx_flash_ids[0].dev_id = (f->chip_id >> 8) & 0xffff;
pxa3xx_flash_ids[0].pagesize = f->page_size;
Expand Down

0 comments on commit 7c2f717

Please sign in to comment.