diff options
Diffstat (limited to 'drivers/mtd/nand/diskonchip.c')
-rw-r--r-- | drivers/mtd/nand/diskonchip.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index 6107f532855b..12608c13cce5 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c | |||
@@ -1635,13 +1635,12 @@ static int __init doc_probe(unsigned long physadr) | |||
1635 | 1635 | ||
1636 | len = sizeof(struct mtd_info) + | 1636 | len = sizeof(struct mtd_info) + |
1637 | sizeof(struct nand_chip) + sizeof(struct doc_priv) + (2 * sizeof(struct nand_bbt_descr)); | 1637 | sizeof(struct nand_chip) + sizeof(struct doc_priv) + (2 * sizeof(struct nand_bbt_descr)); |
1638 | mtd = kmalloc(len, GFP_KERNEL); | 1638 | mtd = kzalloc(len, GFP_KERNEL); |
1639 | if (!mtd) { | 1639 | if (!mtd) { |
1640 | printk(KERN_ERR "DiskOnChip kmalloc (%d bytes) failed!\n", len); | 1640 | printk(KERN_ERR "DiskOnChip kmalloc (%d bytes) failed!\n", len); |
1641 | ret = -ENOMEM; | 1641 | ret = -ENOMEM; |
1642 | goto fail; | 1642 | goto fail; |
1643 | } | 1643 | } |
1644 | memset(mtd, 0, len); | ||
1645 | 1644 | ||
1646 | nand = (struct nand_chip *) (mtd + 1); | 1645 | nand = (struct nand_chip *) (mtd + 1); |
1647 | doc = (struct doc_priv *) (nand + 1); | 1646 | doc = (struct doc_priv *) (nand + 1); |