iscsi: Move error path to the end of the function

Moving error path to the end of the function will be easier to read.

Change-Id: I35bfd9b12d83ccb6fffe159b68dd08c87f6de0fb
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/436229
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2018-12-06 08:22:03 +09:00 committed by Jim Harris
parent 193ecb2c4b
commit d22d136bfc

View File

@ -336,10 +336,7 @@ spdk_iscsi_conn_construct(struct spdk_iscsi_portal *portal,
rc = spdk_iscsi_conn_params_init(&conn->params);
if (rc < 0) {
SPDK_ERRLOG("iscsi_conn_params_init() failed\n");
error_return:
spdk_iscsi_param_free(conn->params);
free_conn(conn);
return -1;
goto error_return;
}
conn->logout_timer = NULL;
conn->shutdown_timer = NULL;
@ -351,6 +348,11 @@ error_return:
spdk_iscsi_poll_group_add_conn(conn);
return 0;
error_return:
spdk_iscsi_param_free(conn->params);
free_conn(conn);
return -1;
}
void