Skip to content

Commit ea5600c

Browse files
shroffnidwsuse
authored andcommitted
libnvme : record the nvme pci adapter physical slot
There is a subtle bug in the nvme controller physical slot lookup code due to which the readdir() prematurely aborts the lookup and hence libnvme fails to record the pci slot address of the nvme controller. This patch helps to fix this issue. Signed-off-by: Nilay Shroff <[email protected]> Signed-off-by: Daniel Wagner <[email protected]>
1 parent fbd0a2c commit ea5600c

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
@@ -1729,7 +1729,7 @@ static char *nvme_ctrl_lookup_phy_slot(nvme_root_t r, const char *address)
17291729
}
17301730

17311731
target_addr = strndup(address, 10);
1732-
while (!(entry = readdir(slots_dir))) {
1732+
while ((entry = readdir(slots_dir))) {
17331733
if (entry->d_type == DT_DIR &&
17341734
strncmp(entry->d_name, ".", 1) != 0 &&
17351735
strncmp(entry->d_name, "..", 2) != 0) {

0 commit comments

Comments
 (0)