PCI: Avoid accessing memory outside the ROM BAR
authorRex Zhu <Rex.Zhu@amd.com>
Tue, 5 Jun 2018 01:46:45 +0000 (09:46 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 30 Jun 2018 02:07:17 +0000 (21:07 -0500)
commit445ec321e71b3124abacfb358f72ac6a70d87602
treeacbecd71b968ec0667bcebed2652d5111edc8e5e
parent11eb0e0e8dea8b97cff972b09cf6fb033b729dff
PCI: Avoid accessing memory outside the ROM BAR

pci_get_rom_size() accepts the base and size of the ROM BAR as arguments.
The byte at "rom + size" is the first byte *past* the ROM, so change ">" to
">=" to avoid accessing beyond the actual length of the ROM BAR.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/pci/rom.c