Skip to content

Commit fa2ab27

Browse files
dwsuseigaw
authored andcommitted
tree: Ignore NULL address pointer for phy slot lookup
The PCI physical slot lookup works obviously only for physical cards. Thus do not try to dereference the address pointer if it is a NULL pointer. Fixes: 42ac453 ("tree: Add PCI physical slot number for controller") Signed-off-by: Daniel Wagner <[email protected]>
1 parent ac1584a commit fa2ab27

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/nvme/tree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,9 @@ static char *nvme_ctrl_lookup_phy_slot(nvme_root_t r, const char *address)
12741274
DIR *slots_dir;
12751275
struct dirent *entry;
12761276

1277+
if (!address)
1278+
return NULL;
1279+
12771280
slots_dir = opendir(nvme_slots_sysfs_dir);
12781281
if (!slots_dir) {
12791282
nvme_msg(r, LOG_WARNING, "failed to open slots dir %s\n",

0 commit comments

Comments
 (0)