nvmf/tcp: use free() to release transport when create fails

Using nvmf_tcp_destroy() would destroy ttransport->lock, which hasn't
been initialized by that point yet.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie9ced97ef520236dddaa70453b6807e8382ce534
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7235
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Konrad Sztyber 2021-04-02 14:59:02 +02:00 committed by Jim Harris
parent c84ecccca3
commit c6b9113ba7

View File

@ -603,7 +603,7 @@ nvmf_tcp_create(struct spdk_nvmf_transport_opts *opts)
"per-poll group caches for each thread. (%" PRIu32 ")"
"supplied. (%" PRIu32 ") required\n", opts->num_shared_buffers, min_shared_buffers);
SPDK_ERRLOG("Please specify a larger number of shared buffers\n");
nvmf_tcp_destroy(&ttransport->transport, NULL, NULL);
free(ttransport);
return NULL;
}