]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mtd: pxa3xx_nand: initialiaze pxa3xx_flash_ids to 0
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Thu, 12 Feb 2015 14:53:27 +0000 (15:53 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Sat, 28 Feb 2015 09:26:35 +0000 (01:26 -0800)
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>
drivers/mtd/nand/pxa3xx_nand.c

index 57562c85cc8cd74e4f1d32605213ddb295147cbe..b1ecb570d1545243e1598b1de9ea43086c8a5a54 100644 (file)
@@ -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;