loader: Fix error handling after an allocation failure

MFC after:	1 week
This commit is contained in:
Mark Johnston committed 2026-07-22 00:17:56 +00:00
1 parent 2efe148a2a
commit 5001af647b
1 file changed
+1 -1
+1 -1
View File
@@ -163,7 +163,7 @@ elf64_exec(struct preloaded_file *fp)
(EFI_PHYSICAL_ADDRESS *)&PT4);
if (EFI_ERROR(err)) {
printf("Unable to allocate trampoline page table\n");
BS->FreePages(trampcode, 9);
BS->FreePages(trampcode, 1);
if (copy_auto)
copy_staging = COPY_STAGING_AUTO;
return (ENOMEM);