summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-26 13:53:09 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-17 07:29:55 +0100
commit9a21cc1c2c008f1cab2340fdf80b10074e88efc6 (patch)
tree61e81afe26bd83854d1c72ea33295b93358cf4ec /drivers/pci/pci.c
parent90b6f60061356d500fbbaa3c72bcff411b9e5f46 (diff)
downloadbarebox-9a21cc1c2c008f1cab2340fdf80b10074e88efc6.tar.gz
barebox-9a21cc1c2c008f1cab2340fdf80b10074e88efc6.tar.xz
pci: fix copy-paste bug
Test for the correct resource before derefencing it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/pci/pci.c')
-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 cb8c5394b..d6e95c3ec 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -53,7 +53,7 @@ void register_pci_controller(struct pci_controller *hose)
else
last_mem = 0;
- if (bus->resource[PCI_BUS_RESOURCE_MEM])
+ if (bus->resource[PCI_BUS_RESOURCE_MEM_PREF])
last_mem_pref = bus->resource[PCI_BUS_RESOURCE_MEM_PREF]->start;
else
last_mem_pref = 0;