summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2018-09-13 00:00:06 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-17 09:33:54 +0200
commit183d018fc35383676f8cd8c449ee2570a8233025 (patch)
tree0278bfd1bcc76ab9706ea6c909601fd1439a67df
parent94c6c854159203a3d437d15ea285ac1e80ed5460 (diff)
downloadbarebox-183d018fc35383676f8cd8c449ee2570a8233025.tar.gz
barebox-183d018fc35383676f8cd8c449ee2570a8233025.tar.xz
pci_of_match_device: don't crash on MIPS Malta
In arch/mips/mach-malta/pci.c PCI controller is instantiated without dt and struct pci_controller parent field is NULL. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/pci/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d206c53848..7abc7a3439 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -339,7 +339,7 @@ pci_of_match_device(struct device_d *parent, unsigned int devfn)
struct device_node *np;
u32 reg;
- if (!IS_ENABLED(CONFIG_OFTREE) || !parent->device_node)
+ if (!IS_ENABLED(CONFIG_OFTREE) || !parent || !parent->device_node)
return NULL;
for_each_child_of_node(parent->device_node, np) {