From: Bin Meng Date: Fri, 22 Jun 2018 08:38:31 +0000 (-0700) Subject: cmd: efi: Fix wrong memory descriptor end address X-Git-Tag: v2018.07-rc3~18^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dd099ec44b5d0a5d2dff537fc5b3b3441a49eec6;p=oweals%2Fu-boot.git 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 Reviewed-by: Simon Glass --- diff --git a/cmd/efi.c b/cmd/efi.c index 2511c6cb78..6c1eb88424 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;