From: Sebastian Andrzej Siewior Date: Wed, 28 Nov 2012 01:49:44 +0000 (-0800) Subject: target/configfs: allocate only 6 slots for dev_cg->default_groups X-Git-Tag: v3.8-rc1~94^2~12 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a5675c8a8b72efdd09ccd1b0975c4670675775ef;p=linux.git target/configfs: allocate only 6 slots for dev_cg->default_groups Only slots 0-5 are used so 6 slots should be enough. I don't see anyone writting anything else than NULL into ->default_groups[5] so a "late" initialisation should not happen here. (nab: Fix up minor apply breakage in for-next) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 02fd55d3a76e..f6fc258b9d40 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -2496,7 +2496,7 @@ static struct config_group *target_core_make_subdev( dev_cg = &dev->dev_group; - dev_cg->default_groups = kzalloc(sizeof(struct config_group *) * 7, + dev_cg->default_groups = kzalloc(sizeof(struct config_group *) * 6, GFP_KERNEL); if (!dev_cg->default_groups) goto out_free_device;