From: Bjorn Helgaas Date: Fri, 19 May 2017 19:37:53 +0000 (-0500) Subject: efi/fb: Correct PCI_STD_RESOURCE_END usage X-Git-Tag: v4.13-rc1~88^2~22^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=92a16c86299c64f58f320e491977408ba31b8c3c;p=karo-tx-linux.git efi/fb: Correct PCI_STD_RESOURCE_END usage 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 --- diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index b827a8113e26..ff01bed7112f 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -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))