]> git.dujemihanovic.xyz Git - u-boot.git/commit
pci: Range check address conversions
authorAndrew Scull <ascull@google.com>
Thu, 21 Apr 2022 16:11:08 +0000 (16:11 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 3 May 2022 19:50:45 +0000 (15:50 -0400)
commit398dc367c53dcff4f61116a3de66ba4e4e6b8586
tree3224eda3a6f0c361a5c504de5ec0ed309170c091
parentec8eba8c2d4e10e77699c56918d2078210aa1339
pci: Range check address conversions

When converting between PCI bus and physical addresses, include a length
parameter that can be used to check that the entire range fits within
one of the PCI regions. This prevents an address being returned that
might be only partially valid for the range it is going to be used for.

Where the range check is not wanted, passing a length of 0 will have the
same behaviour as before this change.

Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/pci/pci-uclass.c
include/pci.h