]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
loader/ia64/efi/linux: Reset grub_errno on failure to allocate
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 7 Apr 2025 19:05:40 +0000 (22:05 +0300)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Apr 2025 17:39:27 +0000 (19:39 +0200)
The code goes on to allocate memory in another region on failure, hence
it should discard the error.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/ia64/efi/linux.c

index 3dd2e8236fba3e4ab8e878a100eb3488053f2f56..99cb244d8703c58eb7cc0e40601c9e68e315854f 100644 (file)
@@ -383,6 +383,7 @@ grub_load_elf64 (grub_file_t file, void *buffer, const char *filename)
     {
       kernel_mem = grub_efi_allocate_fixed (low_addr, kernel_pages);
       reloc_offset = 0;
+      grub_errno = GRUB_ERR_NONE;
     }
   /* Try to relocate.  */
   if (! kernel_mem && (!relocate || grub_strcmp (relocate, "off") != 0))