]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
tree: fix segfault in nvme_scan_subsystem()
authorMartin George <marting@netapp.com>
Tue, 8 Aug 2023 16:30:25 +0000 (22:00 +0530)
committerDaniel Wagner <wagi@monom.org>
Wed, 9 Aug 2023 10:57:02 +0000 (12:57 +0200)
The wrong nvme_subsystem struct was being passed to
__nvme_subsystem_scan() which caused it to segfault.
Fix it.

Fixes: d08fd10 ("make __nvme_scan_subsystem() returning bool")
Signed-off-by: Martin George <marting@netapp.com>
src/nvme/tree.c

index 208e7caa8034011c3929b6415f24a6afd02b1cab..0405b335fb773245dee31e715d709591f96aa0f4 100644 (file)
@@ -692,7 +692,7 @@ static int nvme_scan_subsystem(struct nvme_root *r, const char *name,
                                continue;
                        if (strcmp(_s->name, name))
                                continue;
-                       if (!__nvme_scan_subsystem(r, s, f, f_args)) {
+                       if (!__nvme_scan_subsystem(r, _s, f, f_args)) {
                                errno = -EINVAL;
                                goto out_free;
                        }