diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2018-09-13 00:00:06 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-09-18 07:41:43 +0200 |
commit | a807f76304d02928a6a89d56930c4259ddb0736a (patch) | |
tree | 2ee9c23ad776f5ab443d1041f724a8b0e4778d4b | |
parent | 710c63b526951938b46869a7bde86411b5a497a6 (diff) | |
download | barebox-a807f76304d02928a6a89d56930c4259ddb0736a.tar.gz barebox-a807f76304d02928a6a89d56930c4259ddb0736a.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.c | 2 |
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) { |