From 1c98d2f439f3f945c5040fd648d817e86314f2fa Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 27 Nov 2012 18:54:19 +0100 Subject: target/configfs: allocate pointers instead of full struct for default_groups default_groups is defined as struct config_group **default_groups so we don't need to allocate a whole struct but only enough space for a pointer that points there. (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 816347c34392..efe31a00a7cb 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 = kzalloc(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 = kzalloc(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 = kzalloc(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