提交 9df1c6ec 编写于 作者: S Shawn Lin 提交者: Bjorn Helgaas

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: NShawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 7babfa5b
...@@ -5611,8 +5611,9 @@ static int of_pci_bus_find_domain_nr(struct device *parent) ...@@ -5611,8 +5611,9 @@ static int of_pci_bus_find_domain_nr(struct device *parent)
use_dt_domains = 0; use_dt_domains = 0;
domain = pci_get_new_domain_nr(); domain = pci_get_new_domain_nr();
} else { } else {
dev_err(parent, "Node %pOF has inconsistent \"linux,pci-domain\" property in DT\n", if (parent)
parent->of_node); pr_err("Node %pOF has ", parent->of_node);
pr_err("Inconsistent \"linux,pci-domain\" property in DT\n");
domain = -1; domain = -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册