diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-11-15 14:10:29 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-11-28 18:47:21 -0500 |
commit | 95b93a0cd46682c6d9e8eea803fda510cb6b863a (patch) | |
tree | 7e430d3fc04ed20791187d144730dd3052292c67 /drivers/mtd/mtdpart.c | |
parent | 998a43e72d20afa7566dad66fd866fe939a89c09 (diff) |
[MTD] replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <yan_952@hotmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
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 */ |