efi/fb: Correct PCI_STD_RESOURCE_END usage
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 19 May 2017 19:37:53 +0000 (14:37 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 13 Jun 2017 16:44:23 +0000 (11:44 -0500)
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: 55d728a40d36 ("efi/fb: Avoid reconfiguration of BAR that covers the framebuffer")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/video/fbdev/efifb.c

index b827a8113e26803d8caee69e4ea59d6ceae56ea0..ff01bed7112f1566ca13b3e17330851bf02fec05 100644 (file)
@@ -408,7 +408,7 @@ static void efifb_fixup_resources(struct pci_dev *dev)
        if (!base)
                return;
 
-       for (i = 0; i < PCI_STD_RESOURCE_END; i++) {
+       for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
                struct resource *res = &dev->resource[i];
 
                if (!(res->flags & IORESOURCE_MEM))