git: 7eb4c67be503 - stable/15 - loader: Fix error handling after an allocation failure

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a74a1c7.46c8c.1154b92a__20952.6499894977$1786028511$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=7eb4c67be503176d4824d8eaccd70ae942569e54

commit 7eb4c67be503176d4824d8eaccd70ae942569e54
Author:     Mark Johnston <[email protected]>
AuthorDate: 2026-07-22 00:17:56 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2026-08-06 12:52:27 +0000

    loader: Fix error handling after an allocation failure
    
    MFC after:      1 week
    
    (cherry picked from commit 5001af647b3b263aeb3d4fa7a6c2690399265202)
---
 stand/efi/loader/arch/amd64/elf64_freebsd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c
index 62716d7b1369..fa7bc82c2fb2 100644
--- a/stand/efi/loader/arch/amd64/elf64_freebsd.c
+++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c
@@ -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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.