]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_client: efi_store_memory_map() must return int
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 4 Nov 2025 22:27:12 +0000 (23:27 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 6 Nov 2025 22:26:28 +0000 (23:26 +0100)
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.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_client/efi.c

index bcb34d67465d0f629f8265eddece16123ed5b224..a3a40b5549dab7ed2c4e321707afb0b31038430c 100644 (file)
@@ -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;