summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVincent StehlĂ© <[email protected]>2026-02-16 12:30:16 +0100
committerHeinrich Schuchardt <[email protected]>2026-02-27 12:14:56 +0100
commit3768968b1ea7abd587df1fcc3f9a528203fccb13 (patch)
treeabc2d7d249fa9c31e125a2ec41c703ab75113f7e /lib
parent437ea9f8be5afaebe2d8cbab6242f1182857f21e (diff)
efi_loader: fix specific LoadImage() return code
When the LoadImage() UEFI function is called with both its SourceBuffer and DevicePath input arguments equal to NULL, it must return EFI_NOT_FOUND [1]. However, it does return EFI_INVALID_PARAMETER instead; fix it. Link: https://uefi.org/specs/UEFI/2.11/07_Services_Boot_Services.html#efi-boot-services-loadimage [1] Reported-by: Sathisha Shivaramappa <[email protected]> Signed-off-by: Vincent StehlĂ© <[email protected]> Cc: Heinrich Schuchardt <[email protected]> Cc: Ilias Apalodimas <[email protected]> Cc: Tom Rini <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_boottime.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index b424d924896..de57823bd44 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2096,8 +2096,12 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy,
EFI_ENTRY("%d, %p, %pD, %p, %zu, %p", boot_policy, parent_image,
file_path, source_buffer, source_size, image_handle);
- if (!image_handle || (!source_buffer && !file_path) ||
- !efi_search_obj(parent_image) ||
+ if (!source_buffer && !file_path) {
+ ret = EFI_NOT_FOUND;
+ goto error;
+ }
+
+ if (!image_handle || !efi_search_obj(parent_image) ||
/* The parent image handle must refer to a loaded image */
!parent_image->type) {
ret = EFI_INVALID_PARAMETER;