diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-10-03 09:43:19 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-10-03 09:43:19 -0500 |
commit | fb6b6cc41bed72cbafb0d01ab139a4a5ad673e01 (patch) | |
tree | a5af55477a61f7f5c7e507547fefafb0af8cdcf3 /drivers/pci/host/pci-host-common.c | |
parent | 4dc2db096a9f7c0316bafc18ee00d89e0acf4ebf (diff) | |
parent | 13f392ebc37e31568fae72a73ee378ae22a9740f (diff) | |
download | linux-stable-fb6b6cc41bed72cbafb0d01ab139a4a5ad673e01.tar.gz linux-stable-fb6b6cc41bed72cbafb0d01ab139a4a5ad673e01.tar.bz2 linux-stable-fb6b6cc41bed72cbafb0d01ab139a4a5ad673e01.zip |
Merge branch 'pci/enumeration' into next
* pci/enumeration:
PCI: tegra: Fix pci_remap_iospace() failure path
PCI: generic: Fix pci_remap_iospace() failure path
PCI: rcar: Fix pci_remap_iospace() failure path
PCI: versatile: Fix pci_remap_iospace() failure path
PCI: designware: Fix pci_remap_iospace() failure path
PCI: aardvark: Fix pci_remap_iospace() failure path
Diffstat (limited to 'drivers/pci/host/pci-host-common.c')
-rw-r--r-- | drivers/pci/host/pci-host-common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/pci/host/pci-host-common.c b/drivers/pci/host/pci-host-common.c index 946382fd4ea1..e3c48b5deb93 100644 --- a/drivers/pci/host/pci-host-common.c +++ b/drivers/pci/host/pci-host-common.c @@ -30,7 +30,7 @@ static int gen_pci_parse_request_of_pci_ranges(struct device *dev, int err, res_valid = 0; struct device_node *np = dev->of_node; resource_size_t iobase; - struct resource_entry *win; + struct resource_entry *win, *tmp; err = of_pci_get_host_bridge_resources(np, 0, 0xff, resources, &iobase); if (err) @@ -40,15 +40,17 @@ static int gen_pci_parse_request_of_pci_ranges(struct device *dev, if (err) return err; - resource_list_for_each_entry(win, resources) { + resource_list_for_each_entry_safe(win, tmp, resources) { struct resource *res = win->res; switch (resource_type(res)) { case IORESOURCE_IO: err = pci_remap_iospace(res, iobase); - if (err) + if (err) { dev_warn(dev, "error %d: failed to map resource %pR\n", err, res); + resource_list_destroy_entry(win); + } break; case IORESOURCE_MEM: res_valid |= !(res->flags & IORESOURCE_PREFETCH); |