summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-05-19 22:40:50 +0300
committerBen Hutchings <ben@decadent.org.uk>2017-10-12 17:27:10 +0300
commitbf97987fb94cc7d90154a217a3464d46efb8ee69 (patch)
tree277b5b1bc38bf7db8fb7cf00d0721030487b9053
parent1bddbbc4697f96a3b68633621e5c13d9e173f263 (diff)
downloadlinux-bf97987fb94cc7d90154a217a3464d46efb8ee69.tar.xz
PCI: Correct PCI_STD_RESOURCE_END usage
commit 2f686f1d9beee135de6d08caea707ec7bfc916d4 upstream. PCI_STD_RESOURCE_END is (confusingly) the index of the last valid BAR, not the *number* of BARs. To iterate through all possible BARs, we need to include PCI_STD_RESOURCE_END. Fixes: 9fe373f9997b ("PCI: Increase IBM ipr SAS Crocodile BARs to at least system page size") Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/pci/quirks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ea6123f500d9..9290d239d570 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -358,7 +358,7 @@ static void quirk_extend_bar_to_page(struct pci_dev *dev)
{
int i;
- for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+ for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
struct resource *r = &dev->resource[i];
if (r->flags & IORESOURCE_MEM && resource_size(r) < PAGE_SIZE) {