Skip to content

Commit

Permalink
efi/libstub/x86: Remove pointless zeroing of apm_bios_info
Browse files Browse the repository at this point in the history
We have some code in the EFI stub entry point that takes the address
of the apm_bios_info struct in the newly allocated and zeroed out
boot_params structure, only to zero it out again. This is pointless
so remove it.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
  • Loading branch information
Ard Biesheuvel committed Feb 22, 2020
1 parent 3b9274e commit e6d832e
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions arch/x86/boot/compressed/eboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
efi_system_table_t *sys_table_arg)
{
struct boot_params *boot_params;
struct apm_bios_info *bi;
struct setup_header *hdr;
efi_loaded_image_t *image;
efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
Expand Down Expand Up @@ -389,7 +388,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
memset(boot_params, 0x0, 0x4000);

hdr = &boot_params->hdr;
bi = &boot_params->apm_bios_info;

/* Copy the second sector to boot_params */
memcpy(&hdr->jump, image->image_base + 512, 512);
Expand All @@ -416,9 +414,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
hdr->ramdisk_image = 0;
hdr->ramdisk_size = 0;

/* Clear APM BIOS info */
memset(bi, 0, sizeof(*bi));

status = efi_parse_options(cmdline_ptr);
if (status != EFI_SUCCESS)
goto fail2;
Expand Down

0 comments on commit e6d832e

Please sign in to comment.