From: Bin Meng Date: Tue, 27 Mar 2018 00:46:06 -0700 Subject: [U-Boot] [PATCH 2/2] dm: pci: Avoid setting a PCI region that has 0 size In-Reply-To: <1522136766-30991-1-git-send-email-bmeng.cn@gmail.com> References: <1522136766-30991-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1522136766-30991-2-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de It makes no sense to set a PCI region that has 0 size. Signed-off-by: Bin Meng --- drivers/pci/pci-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 9d51236..a2e8296 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; -- 2.7.4