diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c index a8de5f8b98..5d71f5ebcf 100644 --- a/lib/nvme/nvme_ctrlr.c +++ b/lib/nvme/nvme_ctrlr.c @@ -1190,8 +1190,6 @@ nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr) while (!TAILQ_EMPTY(&ctrlr->active_io_qpairs)) { struct spdk_nvme_qpair *qpair = TAILQ_FIRST(&ctrlr->active_io_qpairs); - nvme_qpair_destroy(qpair); - spdk_nvme_ctrlr_free_io_qpair(qpair); } diff --git a/lib/nvme/nvme_pcie.c b/lib/nvme/nvme_pcie.c index b4fbaadf11..dce9475fed 100644 --- a/lib/nvme/nvme_pcie.c +++ b/lib/nvme/nvme_pcie.c @@ -1265,6 +1265,7 @@ nvme_pcie_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ return -1; } + nvme_qpair_destroy(qpair); spdk_free(pqpair); return 0;