Skip to content

Commit

Permalink
efi/fb: Correct PCI_STD_RESOURCE_END usage
Browse files Browse the repository at this point in the history
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: 55d728a ("efi/fb: Avoid reconfiguration of BAR that covers the framebuffer")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Bjorn Helgaas committed Jun 13, 2017
1 parent 7ee214b commit 92a16c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/fbdev/efifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 92a16c8

Please sign in to comment.