From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH] ia64: Reset grub_errno on failure to allocate
Date: Mon,  7 Apr 2025 22:05:40 +0300	[thread overview]
Message-ID: <20250407190549.2241164-1-phcoder@gmail.com> (raw)

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>
---
 grub-core/loader/ia64/efi/linux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c
index 3dd2e8236..99cb244d8 100644
--- a/grub-core/loader/ia64/efi/linux.c
+++ b/grub-core/loader/ia64/efi/linux.c
@@ -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))
-- 
2.49.0
