efi_loader: do_bootefi_exec should always return an EFI status code
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 3 Mar 2018 14:29:01 +0000 (15:29 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 4 Apr 2018 09:00:06 +0000 (11:00 +0200)
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>
Signed-off-by: Alexander Graf <agraf@suse.de>
cmd/bootefi.c

index 3f4f214a8193b0bc1d2e54fcec3d43cda52638bc..9f02c5a664d626fed262eeb51da28fc7591c2e69 100644 (file)
@@ -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;
        }