From ea015e9b6cb10527e55bbf0f7b01640a370632d4 Mon Sep 17 00:00:00 2001 From: Martin George Date: Fri, 2 Aug 2024 00:32:27 +0530 Subject: [PATCH] nvme: avoid segfault in show-topology The show-topology command currently ends in a segfault for ENOENT scenarios: nvme show-topology Failed to scan topology: No such file or directory Segmentation fault (core dumped) Fix this by eliminating the call to nvme_free_tree() since the cleanup helper is already available here. Signed-off-by: Martin George --- nvme.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nvme.c b/nvme.c index 3c144698..20dfee64 100644 --- a/nvme.c +++ b/nvme.c @@ -9585,7 +9585,6 @@ static int show_topology_cmd(int argc, char **argv, struct command *command, str err = nvme_scan_topology(r, NULL, NULL); if (err < 0) { nvme_show_error("Failed to scan topology: %s", nvme_strerror(errno)); - nvme_free_tree(r); return err; } -- 2.50.1