diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c index 917a14f63..6630bc28e 100644 --- a/lib/nvmf/vfio_user.c +++ b/lib/nvmf/vfio_user.c @@ -4253,7 +4253,7 @@ _free_ctrlr(void *ctx) struct nvmf_vfio_user_ctrlr *ctrlr = ctx; struct nvmf_vfio_user_endpoint *endpoint = ctrlr->endpoint; - free_sdbl(ctrlr->endpoint->vfu_ctx, ctrlr->sdbl); + free_sdbl(endpoint->vfu_ctx, ctrlr->sdbl); spdk_interrupt_unregister(&ctrlr->intr); ctrlr->intr_fd = -1; @@ -4261,10 +4261,6 @@ _free_ctrlr(void *ctx) free(ctrlr); - if (endpoint == NULL) { - return; - } - if (endpoint->need_async_destroy) { nvmf_vfio_user_destroy_endpoint(endpoint); } else if (endpoint->need_relisten) {