diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2018-03-01 04:26:55 +0300 |
---|---|---|
committer | Bjorn Helgaas <helgaas@kernel.org> | 2018-03-01 21:52:38 +0300 |
commit | 9df1c6ecbf172fedb1f4f76585338860595b9bf7 (patch) | |
tree | 54c09454b9e534af13e8fbf224514d4791bda9c2 | |
parent | 7babfa5b4bf0a9574c9b30f657b1d87abc5a84cf (diff) | |
download | linux-9df1c6ecbf172fedb1f4f76585338860595b9bf7.tar.xz |
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>
-rw-r--r-- | drivers/pci/pci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f6a4dd10d9b0..b7ff5786b76b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -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; } |