Test for the correct resource before derefencing it. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index cb8c539..d6e95c3 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; -- 2.1.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox