aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/gen_probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/chips/gen_probe.c')
-rw-r--r--drivers/mtd/chips/gen_probe.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c
index cdb0f590b40c..77843d560ae4 100644
--- a/drivers/mtd/chips/gen_probe.c
+++ b/drivers/mtd/chips/gen_probe.c
@@ -113,13 +113,12 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi
113 } 113 }
114 114
115 mapsize = (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG; 115 mapsize = (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG;
116 chip_map = kmalloc(mapsize, GFP_KERNEL); 116 chip_map = kzalloc(mapsize, GFP_KERNEL);
117 if (!chip_map) { 117 if (!chip_map) {
118 printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name); 118 printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name);
119 kfree(cfi.cfiq); 119 kfree(cfi.cfiq);
120 return NULL; 120 return NULL;
121 } 121 }
122 memset (chip_map, 0, mapsize);
123 122
124 set_bit(0, chip_map); /* Mark first chip valid */ 123 set_bit(0, chip_map); /* Mark first chip valid */
125 124