Hi Ludwig,

On 2026-06-29T08:00:59, Ludwig Nussel <[email protected]> wrote:
> Fix tcg2_measurement_init call
>
> Needed to fix the previous, forward ported patch
>
> Signed-off-by: Ludwig Nussel <[email protected]>
>
> lib/efi_loader/efi_tcg2.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

As Ilias says, please squash this into patch 5. Landing the broken
call in one patch and fixing it in the next breaks bisect, and after
the squash the commit message can go away entirely.

> diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
> @@ -870,13 +870,10 @@ static efi_status_t efi_init_event_log(void)
>        * vendor_info_size is currently set to 0, we need to change the length
>        * and allocate the flexible array member if this changes
>        */
> -     struct udevice *dev;
> +     struct udevice *dev = NULL;
>       efi_status_t ret;
>       int rc;
>
> -     if (tcg2_platform_get_tpm2(&dev))
> -             return EFI_DEVICE_ERROR;
> -

Dropping the tcg2_platform_get_tpm2() call changes behaviour:
previously efi_init_event_log() returned EFI_DEVICE_ERROR up front if
no TPM device was present, now it falls through and calls
efi_allocate_pool() first, only failing later inside
tcg2_measurement_init(). So we allocate (and free) the event log
buffer even with no TPM. Please either restore the early check or
mention in the squashed commit message why the new ordering is
intentional.

Regards,
Simon

Reply via email to