Commit beced88e authored by Rex Zhu's avatar Rex Zhu Committed by Bjorn Helgaas

PCI: Add check code for last image indicator not set

If the "last image" indicator was not set in the PCI data struct, print "No
more image in the PCI ROM" instead of looping back and printing "Invalid
PCI ROM header signature".
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 445ec321
...@@ -108,6 +108,12 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size) ...@@ -108,6 +108,12 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size)
/* Avoid iterating through memory outside the resource window */ /* Avoid iterating through memory outside the resource window */
if (image >= rom + size) if (image >= rom + size)
break; break;
if (!last_image) {
if (readw(image) != 0xAA55) {
pci_info(pdev, "No more image in the PCI ROM\n");
break;
}
}
} while (length && !last_image); } while (length && !last_image);
/* never return a size larger than the PCI resource window */ /* never return a size larger than the PCI resource window */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment