From: Bin Meng Date: Tue, 27 Mar 2018 07:46:06 +0000 (-0700) Subject: dm: pci: Avoid setting a PCI region that has 0 size X-Git-Tag: v2018.05-rc1~3^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ee1109bb45be4aaf057a44a70c9bdf2d7ff5bbc7;p=u-boot dm: pci: Avoid setting a PCI region that has 0 size It makes no sense to set a PCI region that has 0 size. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 9d51236770..a2e829608a 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -897,8 +897,9 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node, #endif if (gd->pci_ram_top && gd->pci_ram_top < base + size) size = gd->pci_ram_top - base; - pci_set_region(hose->regions + hose->region_count++, base, base, - size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); + if (size) + pci_set_region(hose->regions + hose->region_count++, base, + base, size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); #endif return 0;