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-18 07:41:43 +0200
commita807f76304d02928a6a89d56930c4259ddb0736a (patch)
tree2ee9c23ad776f5ab443d1041f724a8b0e4778d4b
parent710c63b526951938b46869a7bde86411b5a497a6 (diff)
downloadbarebox-a807f76304d02928a6a89d56930c4259ddb0736a.tar.gz
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 d206c53..7abc7a3 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) {