diff options
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r-- | drivers/mtd/mtdpart.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index a20f75fd8d61..89692f898ef4 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -323,14 +323,13 @@ int add_mtd_partitions(struct mtd_info *master, | |||
323 | for (i = 0; i < nbparts; i++) { | 323 | for (i = 0; i < nbparts; i++) { |
324 | 324 | ||
325 | /* allocate the partition structure */ | 325 | /* allocate the partition structure */ |
326 | slave = kmalloc (sizeof(*slave), GFP_KERNEL); | 326 | slave = kzalloc (sizeof(*slave), GFP_KERNEL); |
327 | if (!slave) { | 327 | if (!slave) { |
328 | printk ("memory allocation error while creating partitions for \"%s\"\n", | 328 | printk ("memory allocation error while creating partitions for \"%s\"\n", |
329 | master->name); | 329 | master->name); |
330 | del_mtd_partitions(master); | 330 | del_mtd_partitions(master); |
331 | return -ENOMEM; | 331 | return -ENOMEM; |
332 | } | 332 | } |
333 | memset(slave, 0, sizeof(*slave)); | ||
334 | list_add(&slave->list, &mtd_partitions); | 333 | list_add(&slave->list, &mtd_partitions); |
335 | 334 | ||
336 | /* set up the MTD object for this partition */ | 335 | /* set up the MTD object for this partition */ |