diff options
author | Joern Engel <joern@logfs.org> | 2014-09-02 17:49:57 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-09-17 17:34:50 -0400 |
commit | da0abaee4793bac4047b3bdfd221fc54850bbf5f (patch) | |
tree | d4c02b4db2e7fcf8c3d162f4fefd4f5728a7db77 | |
parent | 8d2135592d2ab5c8d7764a4f534afac64e563691 (diff) |
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: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_fabric_configfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 7228a18b12ad..0638a672d911 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c | |||
@@ -320,7 +320,7 @@ static struct config_group *target_fabric_make_mappedlun( | |||
320 | struct se_node_acl, acl_group); | 320 | struct se_node_acl, acl_group); |
321 | struct se_portal_group *se_tpg = se_nacl->se_tpg; | 321 | struct se_portal_group *se_tpg = se_nacl->se_tpg; |
322 | struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf; | 322 | struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf; |
323 | struct se_lun_acl *lacl; | 323 | struct se_lun_acl *lacl = NULL; |
324 | struct config_item *acl_ci; | 324 | struct config_item *acl_ci; |
325 | struct config_group *lacl_cg = NULL, *ml_stat_grp = NULL; | 325 | struct config_group *lacl_cg = NULL, *ml_stat_grp = NULL; |
326 | char *buf; | 326 | char *buf; |
@@ -406,6 +406,7 @@ static struct config_group *target_fabric_make_mappedlun( | |||
406 | out: | 406 | out: |
407 | if (lacl_cg) | 407 | if (lacl_cg) |
408 | kfree(lacl_cg->default_groups); | 408 | kfree(lacl_cg->default_groups); |
409 | kfree(lacl); | ||
409 | kfree(buf); | 410 | kfree(buf); |
410 | return ERR_PTR(ret); | 411 | return ERR_PTR(ret); |
411 | } | 412 | } |