Skip to content

Commit 8845705

Browse files
hreineckedwsuse
authored andcommitted
tree: use name as argument to nvme_ctrl_lookup_subsystem_name()
When looking up the subsystem in ctrl_lookup_subsystem_name() we only need the controller name, not the entire controller structure. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 3593618 commit 8845705

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/nvme/tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ static int nvme_ctrl_scan_namespaces(struct nvme_ctrl *c)
10751075
return 0;
10761076
}
10771077

1078-
static char *nvme_ctrl_lookup_subsystem_name(nvme_ctrl_t c)
1078+
static char *nvme_ctrl_lookup_subsystem_name(char *ctrl_name)
10791079
{
10801080
struct dirent **subsys;
10811081
char *subsys_name = NULL;
@@ -1089,7 +1089,7 @@ static char *nvme_ctrl_lookup_subsystem_name(nvme_ctrl_t c)
10891089
struct stat st;
10901090

10911091
sprintf(path, "%s/%s/%s", nvme_subsys_sysfs_dir,
1092-
subsys[i]->d_name, c->name);
1092+
subsys[i]->d_name, ctrl_name);
10931093
nvme_msg(LOG_DEBUG, "lookup subsystem %s\n", path);
10941094
if (stat(path, &st) < 0)
10951095
continue;
@@ -1162,7 +1162,7 @@ int nvme_init_ctrl(nvme_host_t h, nvme_ctrl_t c, int instance)
11621162
}
11631163
}
11641164

1165-
subsys_name = nvme_ctrl_lookup_subsystem_name(c);
1165+
subsys_name = nvme_ctrl_lookup_subsystem_name(name);
11661166
if (!subsys_name) {
11671167
nvme_msg(LOG_ERR, "Failed to lookup subsystem name for %s\n",
11681168
c->name);

0 commit comments

Comments
 (0)