From: Tom Rini Date: Mon, 23 Nov 2015 17:44:26 -0500 Subject: [U-Boot] pci: fix address range check in __pci_hose_phys_to_bus() In-Reply-To: <1447855506-14584-1-git-send-email-marcel.ziswiler@toradex.com> References: <1447855506-14584-1-git-send-email-marcel.ziswiler@toradex.com> Message-ID: <20151123224426.GW9551@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Nov 18, 2015 at 03:05:06PM +0100, Marcel Ziswiler wrote: > The address range check may overflow if the memory region is located at > the top of the 32-bit address space. This can e.g. be seen on TK1 if > using the E1000 gigabit Ethernet driver where start and size are both > 0x80000000 leading to the following messages: > > Apalis TK1 # tftpboot $loadaddr test_file > Using e1000#0 device > TFTP from server 192.168.10.1; our IP address is 192.168.10.2 > Filename 'test_file'. > Load address: 0x80408000 > Loading: pci_hose_phys_to_bus: invalid physical address > > This patch fixes this by changing the order of the addition vs. > subtraction in the range check just like already done in > __pci_hose_bus_to_phys(). > > Reported-by: Ivan Mercier > Signed-off-by: Marcel Ziswiler > Reviewed-by: Bin Meng > Reviewed-by: Stephen Warren > Acked-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: