aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_bbt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nand_bbt.c')
-rw-r--r--drivers/mtd/nand/nand_bbt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 4e74fe9af29e..5e121ceaa598 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -960,14 +960,12 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
960 struct nand_bbt_descr *md = this->bbt_md; 960 struct nand_bbt_descr *md = this->bbt_md;
961 961
962 len = mtd->size >> (this->bbt_erase_shift + 2); 962 len = mtd->size >> (this->bbt_erase_shift + 2);
963 /* Allocate memory (2bit per block) */ 963 /* Allocate memory (2bit per block) and clear the memory bad block table */
964 this->bbt = kmalloc(len, GFP_KERNEL); 964 this->bbt = kzalloc(len, GFP_KERNEL);
965 if (!this->bbt) { 965 if (!this->bbt) {
966 printk(KERN_ERR "nand_scan_bbt: Out of memory\n"); 966 printk(KERN_ERR "nand_scan_bbt: Out of memory\n");
967 return -ENOMEM; 967 return -ENOMEM;
968 } 968 }
969 /* Clear the memory bad block table */
970 memset(this->bbt, 0x00, len);
971 969
972 /* If no primary table decriptor is given, scan the device 970 /* If no primary table decriptor is given, scan the device
973 * to build a memory based bad block table 971 * to build a memory based bad block table