diff mbox series

[U-Boot,v2,08/11] efi_loader: do_bootefi_exec should always return an EFI status code

Message ID 20180215073144.12979-9-xypron.glpk@gmx.de
State Superseded, archived
Delegated to: Alexander Graf
Headers show
Series efi_loader: error handling cmd/bootefi.c | expand

Commit Message

Heinrich Schuchardt Feb. 15, 2018, 7:31 a.m. UTC
The return type of do_bootefi_exec() is efi_status_t. So in case
of an error we should always return an EFI status code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2
	no change, patch resent
---
 cmd/bootefi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass March 23, 2018, 2:30 p.m. UTC | #1
On 15 February 2018 at 00:31, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> The return type of do_bootefi_exec() is efi_status_t. So in case
> of an error we should always return an EFI status code.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> v2
>         no change, patch resent
> ---
>  cmd/bootefi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index dff86cf9f9a..7d4100ceeb9 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -164,7 +164,7 @@  static efi_status_t do_bootefi_exec(void *efi, void *fdt,
 	struct efi_loaded_image loaded_image_info = {};
 	struct efi_object loaded_image_info_obj = {};
 	struct efi_device_path *memdp = NULL;
-	ulong ret;
+	efi_status_t ret;
 
 	EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
 				     struct efi_system_table *st);
@@ -229,7 +229,7 @@  static efi_status_t do_bootefi_exec(void *efi, void *fdt,
 	/* Load the EFI payload */
 	entry = efi_load_pe(efi, &loaded_image_info);
 	if (!entry) {
-		ret = -ENOENT;
+		ret = EFI_LOAD_ERROR;
 		goto exit;
 	}