Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit fb318ca

Browse files
committed
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>
1 parent 71e49ec commit fb318ca

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/firmware/efi/libstub/x86-stub.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,16 +566,13 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
566566
/* Convert unicode cmdline to ascii */
567567
cmdline_ptr = efi_convert_cmdline(image, &options_size);
568568
if (!cmdline_ptr)
569-
goto fail;
569+
efi_exit(handle, EFI_OUT_OF_RESOURCES);
570570

571571
efi_set_u64_split((unsigned long)cmdline_ptr, &hdr->cmd_line_ptr,
572572
&boot_params.ext_cmd_line_ptr);
573573

574574
efi_stub_entry(handle, sys_table_arg, &boot_params);
575575
/* not reached */
576-
577-
fail:
578-
efi_exit(handle, status);
579576
}
580577

581578
static void add_e820ext(struct boot_params *params,

0 commit comments

Comments
 (0)