diff mbox series

[U-Boot,v2,3/7] efi_loader: Return non-zero for error in efi_add_memory_map()

Message ID 20190714222931.12713-4-pure.logic@nexus-software.ie
State Superseded, archived
Delegated to: Heinrich Schuchardt
Headers show
Series efi_loader: Fix inconsistencies in efi_add_memory_map usage | expand

Commit Message

Bryan O'Donoghue July 14, 2019, 10:29 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index b513553fa4..c1d7b88997 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -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 */