diff options
author | Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de> | 2015-12-23 16:51:57 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-17 12:34:35 -0800 |
commit | f65088dd6b5f1c0567670c7473191c23ef90c3f0 (patch) | |
tree | 1df28b421cc95879e5c8c1a9711e8467f5394be8 | |
parent | 6188cfb97ed5b33080b4052695ec0b8aa53e648d (diff) | |
download | lwn-f65088dd6b5f1c0567670c7473191c23ef90c3f0.tar.gz lwn-f65088dd6b5f1c0567670c7473191c23ef90c3f0.zip |
PCI: Fix minimum allocation address overwrite
commit 3460baa620685c20f5ee19afb6d99d26150c382c upstream.
Commit 36e097a8a297 ("PCI: Split out bridge window override of minimum
allocation address") claimed to do no functional changes but unfortunately
did: The "min" variable is altered. At least the AVM A1 PCMCIA adapter was
no longer detected, breaking ISDN operation.
Use a local copy of "min" to restore the previous behaviour.
[bhelgaas: avoid gcc "?:" extension for portability and readability]
Fixes: 36e097a8a297 ("PCI: Split out bridge window override of minimum allocation address")
Signed-off-by: Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/pci/bus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 38901665c770..f16c43dd6d04 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -147,6 +147,8 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res, type_mask |= IORESOURCE_IO | IORESOURCE_MEM; pci_bus_for_each_resource(bus, r, i) { + resource_size_t min_used = min; + if (!r) continue; @@ -170,12 +172,12 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res, * overrides "min". */ if (avail.start) - min = avail.start; + min_used = avail.start; max = avail.end; /* Ok, try it out.. */ - ret = allocate_resource(r, res, size, min, max, + ret = allocate_resource(r, res, size, min_used, max, align, alignf, alignf_data); if (ret == 0) return 0; |