From: Antoine Ténart Date: Thu, 12 Feb 2015 14:53:27 +0000 (+0100) Subject: mtd: pxa3xx_nand: initialiaze pxa3xx_flash_ids to 0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c2f717668af10ab6d4aaed22a5d29f06812ee62;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Brian Norris --- 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;