Skip to content

Commit

Permalink
[PATCH] PCI: Adjust PCI rom code to handle more broken ROMs
Browse files Browse the repository at this point in the history
There are ROMs reporting that their size exceeds their PCI ROM
resource window. This patch returns the minimum of the resource window
size or the size in the ROM.  An example of this breakage is the XGI
Volari Z7.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jon Smirl authored and Linus Torvalds committed Jul 29, 2005
1 parent e96e2f1 commit 761a3ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pci/rom.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
image += readw(pds + 16) * 512;
} while (!last_image);

*size = image - rom;
/* never return a size larger than the PCI resource window */
/* there are known ROMs that get the size wrong */
*size = min((size_t)(image - rom), *size);

return rom;
}
Expand Down

0 comments on commit 761a3ac

Please sign in to comment.