]> git.ipfire.org Git - people/ms/linux.git/commit
PCI: Fix infinite loop with ROM image of size 0
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 19 Jan 2015 08:53:20 +0000 (17:53 +0900)
committerJiri Slaby <jslaby@suse.cz>
Sun, 1 Mar 2015 22:34:15 +0000 (23:34 +0100)
commitbd4b3c108399d1f842472b77bde81d090d936f0f
tree80056c62f177dab4d2bcda38b6be78f1d6811bf9
parent109102cb30e106fd9e06dcd49a0abfcabacb6439
PCI: Fix infinite loop with ROM image of size 0

commit 16b036af31e1456cb69243a5a0c9ef801ecd1f17 upstream.

If the image size would ever read as 0, pci_get_rom_size() could keep
processing the same image over and over again.  Exit the loop if we ever
read a length of zero.

This fixes a soft lockup on boot when the radeon driver calls
pci_get_rom_size() on an AMD Radeon R7 250X PCIe discrete graphics card.

[bhelgaas: changelog, reference]
Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386973
Reported-by: Federico <federicotg@gmail.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/pci/rom.c