aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-12-09 17:27:36 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2013-12-16 15:42:20 -0500
commitab6dae8236767f9815bb00c29a56d045e33cd470 (patch)
tree906d426063e3a19ed2ed62803ba6319ff7a6123e
parent3f0ed57b26ddd6358b4ab2b9bde652fd683fe02d (diff)
target: Fix sizeof in kmalloc for some default_groups arrays
Allocating an array of pointers, not the objects themselves. These two sites now match all the other sites. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_configfs.c2
-rw-r--r--drivers/target/target_core_fabric_configfs.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 272755d03e5a..a1c23d10468e 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -2937,7 +2937,7 @@ static int __init target_core_init_configfs(void)
2937 * and ALUA Logical Unit Group and Target Port Group infrastructure. 2937 * and ALUA Logical Unit Group and Target Port Group infrastructure.
2938 */ 2938 */
2939 target_cg = &subsys->su_group; 2939 target_cg = &subsys->su_group;
2940 target_cg->default_groups = kmalloc(sizeof(struct config_group) * 2, 2940 target_cg->default_groups = kmalloc(sizeof(struct config_group *) * 2,
2941 GFP_KERNEL); 2941 GFP_KERNEL);
2942 if (!target_cg->default_groups) { 2942 if (!target_cg->default_groups) {
2943 pr_err("Unable to allocate target_cg->default_groups\n"); 2943 pr_err("Unable to allocate target_cg->default_groups\n");
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c
index fdadc4d6259a..7de9f0475d05 100644
--- a/drivers/target/target_core_fabric_configfs.c
+++ b/drivers/target/target_core_fabric_configfs.c
@@ -906,7 +906,7 @@ static struct config_group *target_fabric_make_lun(
906 lun_cg->default_groups[1] = NULL; 906 lun_cg->default_groups[1] = NULL;
907 907
908 port_stat_grp = &lun->port_stat_grps.stat_group; 908 port_stat_grp = &lun->port_stat_grps.stat_group;
909 port_stat_grp->default_groups = kzalloc(sizeof(struct config_group) * 4, 909 port_stat_grp->default_groups = kzalloc(sizeof(struct config_group *) * 4,
910 GFP_KERNEL); 910 GFP_KERNEL);
911 if (!port_stat_grp->default_groups) { 911 if (!port_stat_grp->default_groups) {
912 pr_err("Unable to allocate port_stat_grp->default_groups\n"); 912 pr_err("Unable to allocate port_stat_grp->default_groups\n");