[PATCH 1/2] PCI: Avoid access memory outside the resource window

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



change ">" to ">=" to avoid access beyond the actual
length of io memory.

Signed-off-by: Rex Zhu <Rex.Zhu@xxxxxxx>
---
 drivers/pci/rom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index 374a334..a5c6016 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -108,7 +108,7 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size)
 		length = readw(pds + 16);
 		image += length * 512;
 		/* Avoid iterating through memory outside the resource window */
-		if (image > rom + size)
+		if (image >= rom + size)
 			break;
 	} while (length && !last_image);
 
-- 
1.9.1




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux