diff --git a/lib/nvme/nvme_ctrlr_ocssd_cmd.c b/lib/nvme/nvme_ctrlr_ocssd_cmd.c index 650e690569..2eba219cec 100644 --- a/lib/nvme/nvme_ctrlr_ocssd_cmd.c +++ b/lib/nvme/nvme_ctrlr_ocssd_cmd.c @@ -63,6 +63,7 @@ spdk_nvme_ocssd_ctrlr_cmd_geometry(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, { struct nvme_request *req; struct spdk_nvme_cmd *cmd; + int rc; if (!payload || (payload_size != sizeof(struct spdk_ocssd_geometry_data))) { return -EINVAL; @@ -79,7 +80,9 @@ spdk_nvme_ocssd_ctrlr_cmd_geometry(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, cmd = &req->cmd; cmd->opc = SPDK_OCSSD_OPC_GEOMETRY; cmd->nsid = nsid; - nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock); - return nvme_ctrlr_submit_admin_request(ctrlr, req); + rc = nvme_ctrlr_submit_admin_request(ctrlr, req); + + nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock); + return rc; }