From 13f6a91479b06133eb99f1f43be02608eb867313 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 27 Nov 2012 18:54:21 +0100 Subject: target/configfs: use kmalloc() instead of kzalloc() for default groups All elements are assigned even the NULL member at the end so there is no reason to allocate zeroed memory. (nab: Fix up minor apply breakage in for-next) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_fabric_configfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/target/target_core_fabric_configfs.c') diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index efe31a00a7cb..9c6791734ee8 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -357,7 +357,7 @@ static struct config_group *target_fabric_make_mappedlun( } lacl_cg = &lacl->se_lun_group; - lacl_cg->default_groups = kzalloc(sizeof(struct config_group *) * 2, + lacl_cg->default_groups = kmalloc(sizeof(struct config_group *) * 2, GFP_KERNEL); if (!lacl_cg->default_groups) { pr_err("Unable to allocate lacl_cg->default_groups\n"); @@ -373,7 +373,7 @@ static struct config_group *target_fabric_make_mappedlun( lacl_cg->default_groups[1] = NULL; ml_stat_grp = &lacl->ml_stat_grps.stat_group; - ml_stat_grp->default_groups = kzalloc(sizeof(struct config_group *) * 3, + ml_stat_grp->default_groups = kmalloc(sizeof(struct config_group *) * 3, GFP_KERNEL); if (!ml_stat_grp->default_groups) { pr_err("Unable to allocate ml_stat_grp->default_groups\n"); @@ -858,7 +858,7 @@ static struct config_group *target_fabric_make_lun( return ERR_PTR(-EINVAL); lun_cg = &lun->lun_group; - lun_cg->default_groups = kzalloc(sizeof(struct config_group *) * 2, + lun_cg->default_groups = kmalloc(sizeof(struct config_group *) * 2, GFP_KERNEL); if (!lun_cg->default_groups) { pr_err("Unable to allocate lun_cg->default_groups\n"); -- cgit v1.2.3-59-g8ed1b