diff --git a/drivers/pci/of.c b/drivers/pci/of.c index ae1dcae7fe0164..5781b589ee2a59 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -743,6 +743,8 @@ bool of_pci_supply_present(struct device_node *np) struct property *prop; char *supply; + if (!np) return false; + for_each_property_of_node(np, prop) { supply = strrchr(prop->name, '-'); if (supply && !strcmp(supply, "-supply"))