lib/nvmf: destroy the mutex in the error case

Change-Id: I9663075cfa0770ae81112b9b225bb993168025f0
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4652
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
GangCao 2020-10-14 16:52:52 -04:00 committed by Tomasz Zawadzki
parent 5efa3d61ff
commit 2475faff1e

View File

@ -290,6 +290,7 @@ spdk_nvmf_subsystem_create(struct spdk_nvmf_tgt *tgt,
subsystem->ns = calloc(num_ns, sizeof(struct spdk_nvmf_ns *));
if (subsystem->ns == NULL) {
SPDK_ERRLOG("Namespace memory allocation failed\n");
pthread_mutex_destroy(&subsystem->mutex);
free(subsystem);
return NULL;
}