Commit 3c4cb4ea authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: fix up scan-build workaround



The code that actually removed items from the list was removed in
addition to the free() call, which caused a hang on shutdown.

Change-Id: If0e843d0d0ebfa28638b12104da880e70b3e548a
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 91330eb5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@ spdk_nvmf_port_create(int tag)
void
spdk_nvmf_port_destroy(struct spdk_nvmf_port *port)
{
#if 0 // TODO: fix bogus scan-build warning about use-after-free
	struct spdk_nvmf_fabric_intf	*fabric_intf;

	RTE_VERIFY(port != NULL);
@@ -153,11 +152,14 @@ spdk_nvmf_port_destroy(struct spdk_nvmf_port *port)
	while (!TAILQ_EMPTY(&port->head)) {
		fabric_intf = TAILQ_FIRST(&port->head);
		TAILQ_REMOVE(&port->head, fabric_intf, tailq);
#if 0 // TODO: fix bogus scan-build warning about use-after-free
		spdk_nvmf_fabric_intf_destroy(fabric_intf);
#endif
	}

	TAILQ_REMOVE(&g_port_head, port, tailq);

#if 0 // TODO: fix bogus scan-build warning about use-after-free
	free(port);
#endif
}