From patchwork Fri Mar 27 05:27:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 244406 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Fri, 27 Mar 2020 06:27:46 +0100 Subject: [PATCH 02/16] efi_loader: only reserve memory if fdt node enabled In-Reply-To: <20200327052800.11022-1-xypron.glpk@gmx.de> References: <20200327052800.11022-1-xypron.glpk@gmx.de> Message-ID: <20200327052800.11022-3-xypron.glpk@gmx.de> Sub-nodes of /reserved-memory may be disabled. In this case we should not reserve memory in the memory map. Reported-by: Patrick DELAUNAY Fixes: fef907b2e440 ("efi_loader: create reservations after ft_board_setup") Signed-off-by: Heinrich Schuchardt Reviewed-by: Atish Patra --- cmd/bootefi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 3bbe2d6a1a..aaed575505 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -199,7 +199,8 @@ static void efi_carve_out_dt_rsv(void *fdt) * The /reserved-memory node may have children with * a size instead of a reg property. */ - if (addr != FDT_ADDR_T_NONE) + if (addr != FDT_ADDR_T_NONE && + fdtdec_get_is_enabled(fdt, subnode)) efi_reserve_memory(addr, size); subnode = fdt_next_subnode(fdt, subnode); }