From: Martin George Date: Thu, 1 Aug 2024 19:02:27 +0000 (+0530) Subject: nvme: avoid segfault in show-topology X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ea015e9b6cb10527e55bbf0f7b01640a370632d4;p=users%2Fsagi%2Fnvme-cli.git 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 --- 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; }