[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/24] loader/i386/linux.c: Fix cleanup if kernel doesn't support
From: |
Sergii Dmytruk |
Subject: |
[PATCH 18/24] loader/i386/linux.c: Fix cleanup if kernel doesn't support 64-bit addressing |
Date: |
Mon, 26 Aug 2024 15:44:28 +0300 |
Simply returning didn't free file resource nor called
`grub_dl_ref(my_mod)`. Jump to `fail` label instead.
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
---
grub-core/loader/i386/linux.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index f482fa4af..70d42ec8d 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -1128,9 +1128,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__
((unused)),
#ifdef GRUB_MACHINE_EFI
#ifdef __x86_64__
if (grub_le_to_cpu16 (linux_params.version) < 0x0208 &&
- ((grub_addr_t) grub_efi_system_table >> 32) != 0)
- return grub_error(GRUB_ERR_BAD_OS,
- "kernel does not support 64-bit addressing");
+ ((grub_addr_t) grub_efi_system_table >> 32) != 0) {
+ grub_errno = grub_error(GRUB_ERR_BAD_OS,
+ "kernel does not support 64-bit addressing");
+ goto fail;
+ }
#endif
if (grub_le_to_cpu16 (linux_params.version) >= 0x0208)
--
2.46.0
- [PATCH 10/24] include/grub: Introduce Secure Launch Resource Table (SLRT), (continued)
- [PATCH 10/24] include/grub: Introduce Secure Launch Resource Table (SLRT), Sergii Dmytruk, 2024/08/26
- [PATCH 11/24] i386/slaunch: Add basic platform support for secure launch, Sergii Dmytruk, 2024/08/26
- [PATCH 12/24] i386/txt: Add Intel TXT definitions header file, Sergii Dmytruk, 2024/08/26
- [PATCH 13/24] i386/txt: Add Intel TXT core implementation, Sergii Dmytruk, 2024/08/26
- [PATCH 16/24] i386/txt: Initialize TPM 1.2 event log in TXT heap, Sergii Dmytruk, 2024/08/26
- [PATCH 20/24] multiboot2: Implement TXT slaunch support, Sergii Dmytruk, 2024/08/26
- [PATCH 17/24] i386/slaunch: Add secure launch framework and commands, Sergii Dmytruk, 2024/08/26
- [PATCH 14/24] i386/txt: Add Intel TXT ACM module support, Sergii Dmytruk, 2024/08/26
- [PATCH 19/24] multiboot: Make GRUB_MULTIBOOT(make_mbi) return MBI's size, Sergii Dmytruk, 2024/08/26
- [PATCH 15/24] i386/txt: Add Intel TXT verification routines, Sergii Dmytruk, 2024/08/26
- [PATCH 18/24] loader/i386/linux.c: Fix cleanup if kernel doesn't support 64-bit addressing,
Sergii Dmytruk <=
- [PATCH 22/24] i386/slaunch: Add support for AMD SKINIT, Sergii Dmytruk, 2024/08/26
- [PATCH 23/24] multiboot2: Support AMD SKINIT, Sergii Dmytruk, 2024/08/26
- [PATCH 21/24] i386/skinit: Add AMD SKINIT implementation, Sergii Dmytruk, 2024/08/26
- [PATCH 24/24] i386/linux: Add support for AMD SKINIT, Sergii Dmytruk, 2024/08/26