[PATCH] md: convert md to use kzalloc throughout
Replace multiple kmalloc/memset pairs with kzalloc calls. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
2d1f3b5d1b
commit
9ffae0cf3e
@@ -1827,12 +1827,12 @@ static int run(mddev_t *mddev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
mddev->private = kmalloc (sizeof (raid5_conf_t)
|
||||
+ mddev->raid_disks * sizeof(struct disk_info),
|
||||
GFP_KERNEL);
|
||||
mddev->private = kzalloc(sizeof (raid5_conf_t)
|
||||
+ mddev->raid_disks * sizeof(struct disk_info),
|
||||
GFP_KERNEL);
|
||||
if ((conf = mddev->private) == NULL)
|
||||
goto abort;
|
||||
memset (conf, 0, sizeof (*conf) + mddev->raid_disks * sizeof(struct disk_info) );
|
||||
|
||||
conf->mddev = mddev;
|
||||
|
||||
if ((conf->stripe_hashtbl = (struct stripe_head **) __get_free_pages(GFP_ATOMIC, HASH_PAGES_ORDER)) == NULL)
|
||||
|
Reference in New Issue
Block a user