[U-Boot] [PATCH v3 6/8] efi_loader: Update efi_free_pages() to new efi_add_memory_map()
Bryan O'Donoghue
pure.logic at nexus-software.ie
Sun Jul 14 23:01:06 UTC 2019
efi_add_memory_map() now returns efi_status_t not the passed uint64_t
address on success. We need to capture that change in efi_free_pages().
Signed-off-by: Bryan O'Donoghue <pure.logic at nexus-software.ie>
---
lib/efi_loader/efi_memory.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 2b06acb2ae..9c59a9637c 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -496,7 +496,6 @@ void *efi_alloc(uint64_t len, int memory_type)
*/
efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
{
- uint64_t r = 0;
efi_status_t ret;
ret = efi_check_allocated(memory, true);
@@ -510,13 +509,11 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
return EFI_INVALID_PARAMETER;
}
- r = efi_add_memory_map(memory, pages, EFI_CONVENTIONAL_MEMORY, false);
- /* Merging of adjacent free regions is missing */
-
- if (r == memory)
- return EFI_SUCCESS;
+ ret = efi_add_memory_map(memory, pages, EFI_CONVENTIONAL_MEMORY, false);
+ if (ret != EFI_SUCCESS)
+ return EFI_NOT_FOUND;
- return EFI_NOT_FOUND;
+ return ret;
}
/**
--
2.22.0
More information about the U-Boot
mailing list