Found by coverity. Signed-off-by: Joern Engel <joern@xxxxxxxxx> --- drivers/target/target_core_fabric_configfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 7de9f0475d05..ab8a27eff94c 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -381,7 +381,7 @@ static struct config_group *target_fabric_make_mappedlun( if (!lacl_cg->default_groups) { pr_err("Unable to allocate lacl_cg->default_groups\n"); ret = -ENOMEM; - goto out; + goto out2; } config_group_init_type_name(&lacl->se_lun_group, name, @@ -397,12 +397,14 @@ static struct config_group *target_fabric_make_mappedlun( if (!ml_stat_grp->default_groups) { pr_err("Unable to allocate ml_stat_grp->default_groups\n"); ret = -ENOMEM; - goto out; + goto out2; } target_stat_setup_mappedlun_default_groups(lacl); kfree(buf); return &lacl->se_lun_group; +out2: + kfree(lacl); out: if (lacl_cg) kfree(lacl_cg->default_groups); -- 2.0.0.rc0.1.g7b2ba98 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html