]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Fail pci_map_rom() if the option ROM is invalid
authorChangbin Du <changbin.du@intel.com>
Wed, 8 Nov 2017 00:26:53 +0000 (18:26 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 8 Nov 2017 20:47:07 +0000 (14:47 -0600)
commit8fbe43bb702a38499a03ee4a0f8613368c49aa85
treeb215842a21055c1e8ccc854b3b5de7d6f8a4f84c
parentc37553c8ccb860cbd3b51b3d786eeff13350b5d0
PCI: Fail pci_map_rom() if the option ROM is invalid

If we detect a invalid PCI option ROM (e.g., invalid ROM header signature),
we should unmap it immediately and fail. It doesn't make any sense to
return a mapped area with size of 0.

I have seen this case on Intel GVTg vGPU, which has no VBIOS. It will not
cause a real problem, but we should skip it as early as possible.

Signed-off-by: Changbin Du <changbin.du@intel.com>
[bhelgaas: split non-functional change into separate patch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/rom.c