bdev/nvme: destroy the mutex when failing to create disk

Change-Id: I41868021e6f482c9f0c345d197fedb766e6533d6
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9885
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
This commit is contained in:
GangCao 2021-10-15 09:24:49 -04:00 committed by Tomasz Zawadzki
parent c93b5564c8
commit d58d7e3c47

View File

@ -2062,6 +2062,7 @@ nvme_bdev_create(struct nvme_ctrlr *nvme_ctrlr, struct nvme_ns *nvme_ns)
nvme_ns->ns, nvme_ctrlr->prchk_flags, bdev);
if (rc != 0) {
SPDK_ERRLOG("Failed to create NVMe disk\n");
pthread_mutex_destroy(&bdev->mutex);
free(bdev);
return rc;
}