[U-Boot] [PATCH 1/2] pci: Add boundary check for hose->regions

Simon Glass
2019-03-22T07:53:23Z

On Fri, 15 Mar 2019 at 23:32, Thierry Reding <thierry.reding@gmail.com> wrote:
>
> From: Thierry Reding <treding@nvidia.com>
>
> 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>
> ---
> drivers/pci/pci-uclass.c | 5 +++++
> 1 file changed, 5 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>