diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2024-07-04 11:59:23 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2024-07-08 11:17:45 +0300 |
commit | fb318ca0a522295edd6d796fb987e99ec41f0ee5 (patch) | |
tree | 48164f2ce36edcde2865ca3b3da57bc89036c5e4 /drivers/firmware/efi | |
parent | 71e49eccdca6328eecc335ed8f5557bd0ed70fc6 (diff) | |
download | linux-fb318ca0a522295edd6d796fb987e99ec41f0ee5.tar.xz |
x86/efistub: Avoid returning EFI_SUCCESS on error
The fail label is only used in a situation where the previous EFI API
call succeeded, and so status will be set to EFI_SUCCESS. Fix this, by
dropping the goto entirely, and call efi_exit() with the correct error
code.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi')
-rw-r--r-- | drivers/firmware/efi/libstub/x86-stub.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 51b7185f8707..a4d0164ba35e 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -566,16 +566,13 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, /* Convert unicode cmdline to ascii */ cmdline_ptr = efi_convert_cmdline(image, &options_size); if (!cmdline_ptr) - goto fail; + efi_exit(handle, EFI_OUT_OF_RESOURCES); efi_set_u64_split((unsigned long)cmdline_ptr, &hdr->cmd_line_ptr, &boot_params.ext_cmd_line_ptr); efi_stub_entry(handle, sys_table_arg, &boot_params); /* not reached */ - -fail: - efi_exit(handle, status); } static void add_e820ext(struct boot_params *params, |