iscsi: fix double free when failed to start target

When iSCSI target failed to start due to insuccificent resource like PDU pool,
one memory is double freed.

Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453981 (master)

(cherry picked from commit e358eaeeea)
Change-Id: I1b68d4f0f130b024be9f8406c8d1611e92a27787
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457225
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
GangCao 2019-05-10 18:15:45 -04:00 committed by Darek Stojaczyk
parent 754c217d09
commit 93be2ada98

View File

@ -1309,6 +1309,7 @@ iscsi_parse_globals(void)
if (rc != 0) {
SPDK_ERRLOG("spdk_initialize_all_pools() failed\n");
free(g_spdk_iscsi.session);
g_spdk_iscsi.session = NULL;
return -1;
}
@ -1316,6 +1317,7 @@ iscsi_parse_globals(void)
if (rc < 0) {
SPDK_ERRLOG("spdk_initialize_iscsi_conns() failed\n");
free(g_spdk_iscsi.session);
g_spdk_iscsi.session = NULL;
return rc;
}