Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da0abaee authored by Joern Engel's avatar Joern Engel Committed by Nicholas Bellinger
Browse files

target: Fix memory leak on error in target_fabric_make_mappedlun



This patch fixes a memory leak on error in target_fabric_make_mappedlun(),
where se_lun_acl memory does not get released on exit.

Found by coverity.

Signed-off-by: default avatarJoern Engel <joern@logfs.org>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 8d213559
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ static struct config_group *target_fabric_make_mappedlun(
			struct se_node_acl, acl_group);
	struct se_portal_group *se_tpg = se_nacl->se_tpg;
	struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf;
	struct se_lun_acl *lacl;
	struct se_lun_acl *lacl = NULL;
	struct config_item *acl_ci;
	struct config_group *lacl_cg = NULL, *ml_stat_grp = NULL;
	char *buf;
@@ -406,6 +406,7 @@ static struct config_group *target_fabric_make_mappedlun(
out:
	if (lacl_cg)
		kfree(lacl_cg->default_groups);
	kfree(lacl);
	kfree(buf);
	return ERR_PTR(ret);
}