projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d6040c
)
efi_loader: Add check for fallback fdt memory reservation
author
Alexander Graf
<
[email protected]
>
Mon, 3 Jul 2017 11:32:35 +0000
(13:32 +0200)
committer
Alexander Graf
<
[email protected]
>
Mon, 3 Jul 2017 11:35:47 +0000
(13:35 +0200)
When running bootefi, we allocate new space but never check whether
the allocation succeeded. This patch adds a check so that in case
things go wrong, we at least know they did.
Signed-off-by: Alexander Graf <
[email protected]
>
cmd/bootefi.c
patch
|
blob
|
history
diff --git
a/cmd/bootefi.c
b/cmd/bootefi.c
index a0a543496763a801a6aed0a88e982767faeb7712..771300ee94b739e36f16f2c6eed98e539e9b23c0 100644
(file)
--- a/
cmd/bootefi.c
+++ b/
cmd/bootefi.c
@@
-133,7
+133,13
@@
static void *copy_fdt(void *fdt)
&new_fdt_addr) != EFI_SUCCESS) {
/* If we can't put it there, put it somewhere */
new_fdt_addr = (ulong)memalign(4096, fdt_size);
+ if (efi_allocate_pages(1, EFI_BOOT_SERVICES_DATA, fdt_pages,
+ &new_fdt_addr) != EFI_SUCCESS) {
+ printf("ERROR: Failed to reserve space for FDT\n");
+ return NULL;
+ }
}
+
new_fdt = (void*)(ulong)new_fdt_addr;
memcpy(new_fdt, fdt, fdt_totalsize(fdt));
fdt_set_totalsize(new_fdt, fdt_size);