[U-Boot] [PATCH v2 5/7] efi_loader: Update efi_free_pages() to new efi_add_memory_map()
Bryan O'Donoghue
pure.logic at nexus-software.ie
Sun Jul 14 22:29:29 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 | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 4ce3dd8f8c..57016a393b 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -501,13 +501,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