pci_device_to_OF_node() can return null, and list_for_each_entry will
never enter the loop when dev is NULL, so it looks like this test is
a typo.
Reported-by: Julia Lawall <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
struct device_node *child = pci_device_to_OF_node(dev);
- of_scan_pci_bridge(child, dev);
+ if (child)
+ of_scan_pci_bridge(child, dev);
}
}
}