From: ray Date: Sat, 31 Aug 2019 21:28:06 +0000 (+0000) Subject: ARM kernel can get RAM regions three ways: X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8a4d8332546265c104e75747e1d32d7bf8ccd4dc;p=freebsd.git ARM kernel can get RAM regions three ways: o from FDT; o from EFI; o from Linux Boot API (ATAG). U-Boot may pass RAM info all that 3 ways simultaneously. We do select between FDT and EFI, but not for ATAG. So this is not problem fix, but correctness check. MFC after: 2 weeks --- diff --git a/sys/arm/arm/physmem.c b/sys/arm/arm/physmem.c index b8ba1a0b82a..1000a3d17f9 100644 --- a/sys/arm/arm/physmem.c +++ b/sys/arm/arm/physmem.c @@ -264,6 +264,8 @@ insert_region(struct region *regions, size_t rcnt, vm_paddr_t addr, ep = regions + rcnt; for (i = 0, rp = regions; i < rcnt; ++i, ++rp) { + if (rp->addr == addr && rp->size == size) /* Pure dup. */ + return (rcnt); if (flags == rp->flags) { if (addr + size == rp->addr) { rp->addr = addr;