Skip to content

Commit 01ffcb4

Browse files
committed
tree: Handle NULL subsysname in nvme_scan_ctrl()
As noted couple of lines earlier, the subsysname string might be NULL. In that case, defer initialization of nvme_subsystem_t in hope that it would get initialized while scanning subsystems.
1 parent c8f2472 commit 01ffcb4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nvme/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ nvme_ctrl_t nvme_scan_ctrl(nvme_root_t r, const char *name)
13671367
free(subsysnqn);
13681368

13691369
ret = 0;
1370-
if (s && !s->name)
1370+
if (s && !s->name && subsysname)
13711371
ret = nvme_init_subsystem(s, subsysname);
13721372
free(subsysname);
13731373
if (!s || ret < 0) {

0 commit comments

Comments
 (0)