1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

boot: use MAX() where appropriate

This commit is contained in:
Lennart Poettering 2024-08-22 18:20:20 +02:00 committed by Yu Watanabe
parent ce4c4f4c32
commit 167808c6fc

View File

@ -164,7 +164,7 @@ EFI_STATUS linux_exec_efi_handover(
linux_relocated = xmalloc_pages(
AllocateMaxAddress,
EfiLoaderCode,
EFI_SIZE_TO_PAGES(kernel_size_in_memory > kernel->iov_len ? kernel_size_in_memory : kernel->iov_len),
EFI_SIZE_TO_PAGES(MAX(kernel_size_in_memory, kernel->iov_len)),
UINT32_MAX);
linux_buffer = memcpy(
PHYSICAL_ADDRESS_TO_POINTER(linux_relocated.addr), kernel->iov_base, kernel->iov_len);