[PATCH 1/1] efi_client: efi_store_memory_map() must return int

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Tue Nov 4 23:27:12 CET 2025


The type efi_status_t is not compatible with the return type int.

Let efi_store_memory_map() return -EFAULT instead of a truncated EFI error
code.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/efi_client/efi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c
index bcb34d67465..a3a40b5549d 100644
--- a/lib/efi_client/efi.c
+++ b/lib/efi_client/efi.c
@@ -155,7 +155,7 @@ int efi_store_memory_map(struct efi_priv *priv)
 		putc(' ');
 		printhex2(ret);
 		puts(" No memory map\n");
-		return ret;
+		return -EFAULT;
 	}
 	/*
 	 * Since doing a malloc() may change the memory map and also we want to
@@ -168,7 +168,7 @@ int efi_store_memory_map(struct efi_priv *priv)
 	if (!priv->memmap_desc) {
 		printhex2(ret);
 		puts(" No memory for memory descriptor\n");
-		return ret;
+		return -EFAULT;
 	}
 
 	ret = boot->get_memory_map(&priv->memmap_size, priv->memmap_desc,
@@ -177,7 +177,7 @@ int efi_store_memory_map(struct efi_priv *priv)
 	if (ret) {
 		printhex2(ret);
 		puts(" Can't get memory map\n");
-		return ret;
+		return -EFAULT;
 	}
 
 	return 0;
-- 
2.51.0



More information about the U-Boot mailing list