Commit dda78a88 authored by John Levon's avatar John Levon Committed by Tomasz Zawadzki
Browse files

nvmf/vfio-user: fix _free_ctrlr()



In _free_ctrlr(), ->endpoint can never be NULL, and the code was
self-contradictory; assume it's not NULL.

Signed-off-by: default avatarJohn Levon <john.levon@nutanix.com>
Change-Id: I81a449123ca05f64460380dc3a8ad8af2143d166
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15831


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 05edb4d6
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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) {