Merge tag 'efi-2020-07-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-07-rc5 (2)
Fix memory reservations: do not use random bytes from the stack.
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 0f6d0f7..ac713ca 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -189,16 +189,19 @@
if (nodeoffset >= 0) {
subnode = fdt_first_subnode(fdt, nodeoffset);
while (subnode >= 0) {
+ fdt_addr_t fdt_addr, fdt_size;
+
/* check if this subnode has a reg property */
- addr = fdtdec_get_addr_size(fdt, subnode, "reg",
- (fdt_size_t *)&size);
+ fdt_addr = fdtdec_get_addr_size_auto_parent(
+ fdt, nodeoffset, subnode,
+ "reg", 0, &fdt_size, false);
/*
* The /reserved-memory node may have children with
* a size instead of a reg property.
*/
if (addr != FDT_ADDR_T_NONE &&
fdtdec_get_is_enabled(fdt, subnode))
- efi_reserve_memory(addr, size);
+ efi_reserve_memory(fdt_addr, fdt_size);
subnode = fdt_next_subnode(fdt, subnode);
}
}