mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 13:31:02 +07:00
PCI: Fix NULL pointer dereference in of_pci_bus_find_domain_nr()
If the "parent" pointer passed to of_pci_bus_find_domain_nr() is NULL, don't dereference it. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
7babfa5b4b
commit
9df1c6ecbf
@ -5611,8 +5611,9 @@ static int of_pci_bus_find_domain_nr(struct device *parent)
|
||||
use_dt_domains = 0;
|
||||
domain = pci_get_new_domain_nr();
|
||||
} else {
|
||||
dev_err(parent, "Node %pOF has inconsistent \"linux,pci-domain\" property in DT\n",
|
||||
parent->of_node);
|
||||
if (parent)
|
||||
pr_err("Node %pOF has ", parent->of_node);
|
||||
pr_err("Inconsistent \"linux,pci-domain\" property in DT\n");
|
||||
domain = -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user