From 8c8f966643f1812246ec044389e07d481c87983c Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Wed, 25 Jun 2025 14:42:38 +0100 Subject: [PATCH] loader/efi/linux: Remove useless assignment If the following allocation fails this would leave load_options NULL while load_options_size not valid. If the allocation succeed load_options_size is overwritten. Signed-off-by: Frediano Ziglio Reviewed-by: Daniel Kiper --- grub-core/loader/efi/linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c index 78ea07ca8..ba268eccb 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -223,8 +223,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args) grub_error (GRUB_ERR_BAD_FIRMWARE, "missing loaded_image proto"); goto unload; } - loaded_image->load_options_size = len = - (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); + len = (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t); loaded_image->load_options = grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (len)); if (!loaded_image->load_options) -- 2.47.3