From e26ecf65b860ca31ba8b96bdde49a69b63a64915 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Wed, 29 Dec 2021 20:19:36 +0800 Subject: [PATCH] app: add missed spdk_env_fini() call when exiting Change-Id: I5cedf3754b512960808168dc50e36ab55f0c7c7e Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10910 Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Community-CI: Broadcom CI --- app/spdk_lspci/spdk_lspci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/spdk_lspci/spdk_lspci.c b/app/spdk_lspci/spdk_lspci.c index e414217c9..4f733f2fc 100644 --- a/app/spdk_lspci/spdk_lspci.c +++ b/app/spdk_lspci/spdk_lspci.c @@ -74,7 +74,7 @@ print_pci_dev(void *ctx, struct spdk_pci_device *dev) int main(int argc, char **argv) { - int op; + int op, rc = 0; struct spdk_env_opts opts; while ((op = getopt(argc, argv, "h")) != -1) { @@ -102,13 +102,16 @@ main(int argc, char **argv) if (spdk_pci_enumerate(spdk_pci_nvme_get_driver(), pci_enum_cb, NULL)) { printf("Unable to enumerate PCI nvme driver\n"); - return 1; + rc = 1; + goto exit; } printf("\nList of available PCI devices:\n"); spdk_pci_for_each_device(NULL, print_pci_dev); +exit: spdk_vmd_fini(); + spdk_env_fini(); - return 0; + return rc; }