mtd: pxa3xx_nand: initialiaze pxa3xx_flash_ids to 0

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Apr 22 10:59:02 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7c2f717668af10ab6d4aaed22a5d29f06812ee62
Commit:     7c2f717668af10ab6d4aaed22a5d29f06812ee62
Parent:     ed446cc7208d80a7e9ddddc757a4d5767b67b4c7
Author:     Antoine Ténart <antoine.tenart at free-electrons.com>
AuthorDate: Thu Feb 12 15:53:27 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Sat Feb 28 01:26:35 2015 -0800

    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 at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 57562c8..b1ecb57 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;



More information about the linux-mtd-cvs mailing list