]> git.baikalelectronics.ru Git - uboot.git/commit
pci: Add boundary check for hose->regions
authorThierry Reding <treding@nvidia.com>
Fri, 15 Mar 2019 15:32:32 +0000 (16:32 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 23 Apr 2019 21:57:23 +0000 (17:57 -0400)
commit7a8e201ce282d1ef53589406c69688989270d8cd
treeb23369b36dbb5744eb1baec233243b49e42e12c0
parent0b2e0dbb48d657ad7add35fd74c42b90be6a7bba
pci: Add boundary check for hose->regions

Make sure that we don't overflow the hose->regions array, otherwise we
would end up overwriting the hose->region_count field and cause mayhem
to ensue. Also print an error message when we'd be overflowing because
it indicates that there aren't enough regions available and the number
needs to be increased.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/pci/pci-uclass.c