On Thu, Jul 10, 2025 at 03:01:04PM +0100, Frediano Ziglio via Grub-devel wrote:
> According to specifications, for BufferSize:

Which specification? UEFI? For what? EFI_LOAD_FILE2_PROTOCOL.LoadFile()?
Please be precise...

>     On output with a return code of EFI_SUCCESS, the amount of data
>     transferred to Buffer.
>
> so set *buffer_size correctly.
>
> Signed-off-by: Frediano Ziglio <frediano.zig...@cloud.com>
> ---
>  grub-core/loader/efi/linux.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
> index 36dea2931..caeebe1ec 100644
> --- a/grub-core/loader/efi/linux.c
> +++ b/grub-core/loader/efi/linux.c
> @@ -363,6 +363,7 @@ grub_efi_initrd_load_file2 (grub_efi_load_file2_t *this,
>
>    grub_dprintf ("linux", "Providing initrd via EFI_LOAD_FILE2_PROTOCOL\n");
>
> +  *buffer_size = initrd_size;
>    if (grub_initrd_load (&initrd_ctx, buffer))
>      status = GRUB_EFI_DEVICE_ERROR;

The code does not align with the commit message and spec...

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to