@@ -277,7 +277,7 @@ efi_status_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type,
* The user requested to only have RAM overlaps,
* but we hit a non-RAM region. Error out.
*/
- return 0;
+ return EFI_NO_MAPPING;
case EFI_CARVE_NO_OVERLAP:
/* Just ignore this list entry */
break;
@@ -307,7 +307,7 @@ efi_status_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type,
* The payload wanted to have RAM overlaps, but we overlapped
* with an unallocated region. Error out.
*/
- return 0;
+ return EFI_NO_MAPPING;
}
/* Add our new map */
The previous implementation of efi_add_memory_map() returned the passed address on success, instead of an efi_status_t. With the new function signature instead of returning zero, return EFI_NO_MAPPING on carve-out errors. Fixes: 5d00995c361c ("efi_loader: Implement memory allocation and map") Fixes: 74c16acce30b ("efi_loader: Don't allocate from memory holes") Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Alexander Graf <agraf@csgraf.de> Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> --- lib/efi_loader/efi_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)