aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/cmdlinepart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/cmdlinepart.c')
-rw-r--r--drivers/mtd/cmdlinepart.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index a7a7bfe33879..23fab14f1637 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -163,13 +163,12 @@ static struct mtd_partition * newpart(char *s,
163 *num_parts = this_part + 1; 163 *num_parts = this_part + 1;
164 alloc_size = *num_parts * sizeof(struct mtd_partition) + 164 alloc_size = *num_parts * sizeof(struct mtd_partition) +
165 extra_mem_size; 165 extra_mem_size;
166 parts = kmalloc(alloc_size, GFP_KERNEL); 166 parts = kzalloc(alloc_size, GFP_KERNEL);
167 if (!parts) 167 if (!parts)
168 { 168 {
169 printk(KERN_ERR ERRP "out of memory\n"); 169 printk(KERN_ERR ERRP "out of memory\n");
170 return NULL; 170 return NULL;
171 } 171 }
172 memset(parts, 0, alloc_size);
173 extra_mem = (unsigned char *)(parts + *num_parts); 172 extra_mem = (unsigned char *)(parts + *num_parts);
174 } 173 }
175 /* enter this partition (offset will be calculated later if it is zero at this point) */ 174 /* enter this partition (offset will be calculated later if it is zero at this point) */
@@ -346,7 +345,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
346 * 345 *
347 * This function needs to be visible for bootloaders. 346 * This function needs to be visible for bootloaders.
348 */ 347 */
349int mtdpart_setup(char *s) 348static int mtdpart_setup(char *s)
350{ 349{
351 cmdline = s; 350 cmdline = s;
352 return 1; 351 return 1;