tcp: Initialize mutex only if everything else succeeded
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com> Change-Id: Ib0bb6b40852ca4b49d46c2cbeb603b7a2ec4c46f Reviewed-on: https://review.gerrithub.io/434080 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
5ecc5ef110
commit
be0eb272d8
@ -559,7 +559,6 @@ spdk_nvmf_tcp_create(struct spdk_nvmf_transport_opts *opts)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pthread_mutex_init(&ttransport->lock, NULL);
|
||||
TAILQ_INIT(&ttransport->ports);
|
||||
|
||||
ttransport->transport.ops = &spdk_nvmf_transport_tcp;
|
||||
@ -595,6 +594,8 @@ spdk_nvmf_tcp_create(struct spdk_nvmf_transport_opts *opts)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pthread_mutex_init(&ttransport->lock, NULL);
|
||||
|
||||
spdk_io_device_register(ttransport, spdk_nvmf_tcp_mgmt_channel_create,
|
||||
spdk_nvmf_tcp_mgmt_channel_destroy,
|
||||
sizeof(struct spdk_nvmf_tcp_mgmt_channel), "tcp_transport");
|
||||
|
Loading…
Reference in New Issue
Block a user