aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2018-06-22 01:38:31 -0700
committerBin Meng <bmeng.cn@gmail.com>2018-06-24 08:56:33 +0800
commitdd099ec44b5d0a5d2dff537fc5b3b3441a49eec6 (patch)
treea7a80923c54aca218d30980a8ed8f607acf489a0 /cmd
parent598374729e6b3f3070e06bdf2990dd8d10cddbda (diff)
downloadu-boot-dd099ec44b5d0a5d2dff537fc5b3b3441a49eec6.zip
u-boot-dd099ec44b5d0a5d2dff537fc5b3b3441a49eec6.tar.gz
u-boot-dd099ec44b5d0a5d2dff537fc5b3b3441a49eec6.tar.bz2
cmd: efi: Fix wrong memory descriptor end address
Each entry of the EFI memory descriptors occupies map->desc_size, not sizeof(struct efi_mem_desc). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/efi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/efi.c b/cmd/efi.c
index 2511c6c..6c1eb88 100644
--- a/cmd/efi.c
+++ b/cmd/efi.c
@@ -83,7 +83,7 @@ void *efi_build_mem_table(struct efi_entry_memmap *map, int size, bool skip_bs)
prev = NULL;
addr = 0;
dest = base;
- end = base + count;
+ end = (struct efi_mem_desc *)((ulong)base + count * map->desc_size);
for (desc = base; desc < end; desc = efi_get_next_mem_desc(map, desc)) {
bool merge = true;
int type = desc->type;