summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/pxa3xx_nand.c
diff options
context:
space:
mode:
authorAntoine Ténart <antoine.tenart@free-electrons.com>2015-02-12 15:53:27 +0100
committerBrian Norris <computersforpeace@gmail.com>2015-02-28 10:26:35 +0100
commit7c2f717668af10ab6d4aaed22a5d29f06812ee62 (patch)
tree22a84b3254bd0e25ae5fa2e79d44fca415e40c8d /drivers/mtd/nand/pxa3xx_nand.c
parentMerge MTD updates into -next (diff)
downloadlinux-7c2f717668af10ab6d4aaed22a5d29f06812ee62.tar.xz
linux-7c2f717668af10ab6d4aaed22a5d29f06812ee62.zip
mtd: pxa3xx_nand: initialiaze pxa3xx_flash_ids to 0
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>
Diffstat (limited to 'drivers/mtd/nand/pxa3xx_nand.c')
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 57562c85cc8c..b1ecb570d154 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -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;