提交 12d5a43b 编写于 作者: T tangwenji 提交者: Nicholas Bellinger

iscsi-target: fix memory leak in lio_target_tiqn_addtpg()

tpg must free when call core_tpg_register() return fail
Signed-off-by: Ntangwenji <tang.wenji@zte.com.cn>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 24528f08
......@@ -1123,7 +1123,7 @@ static struct se_portal_group *lio_target_tiqn_addtpg(
ret = core_tpg_register(wwn, &tpg->tpg_se_tpg, SCSI_PROTOCOL_ISCSI);
if (ret < 0)
return NULL;
goto free_out;
ret = iscsit_tpg_add_portal_group(tiqn, tpg);
if (ret != 0)
......@@ -1135,6 +1135,7 @@ static struct se_portal_group *lio_target_tiqn_addtpg(
return &tpg->tpg_se_tpg;
out:
core_tpg_deregister(&tpg->tpg_se_tpg);
free_out:
kfree(tpg);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册