]> git.baikalelectronics.ru Git - uboot.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)
commit8358cc9a8f289cd9a3c9ca02d63f74366287d06a
tree3224eda3a6f0c361a5c504de5ec0ed309170c091
parent987ff77657ada4236aaaeb876653d71298b3b998
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