diff mbox series

[v13,7/8] efi_loader: fix EFI_ENTRY point on get_active_pcr_banks

Message ID 20231019162156.80982-8-eajames@linux.ibm.com
State Superseded
Headers show
Series None | expand

Commit Message

Eddie James Oct. 19, 2023, 4:21 p.m. UTC
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>

efi_tcg2_get_active_pcr_banks doesn't immediately call the
EFI_ENTRY() wrapper once it enters the function. Move the call a
few lines above to cover the error cases properly as well.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 lib/efi_loader/efi_tcg2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Heinrich Schuchardt Oct. 19, 2023, 5:49 p.m. UTC | #1
On 10/19/23 18:21, Eddie James wrote:
> From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
>
> efi_tcg2_get_active_pcr_banks doesn't immediately call the
> EFI_ENTRY() wrapper once it enters the function. Move the call a
> few lines above to cover the error cases properly as well.
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>   lib/efi_loader/efi_tcg2.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
> index 7ada536568..dae1b166c8 100644
> --- a/lib/efi_loader/efi_tcg2.c
> +++ b/lib/efi_loader/efi_tcg2.c
> @@ -949,16 +949,16 @@ efi_tcg2_get_active_pcr_banks(struct efi_tcg2_protocol *this,
>   	struct udevice *dev;
>   	efi_status_t ret;
>
> +	EFI_ENTRY("%p, %p", this, active_pcr_banks);
> +
>   	if (!this || !active_pcr_banks) {
>   		ret = EFI_INVALID_PARAMETER;
>   		goto out;
>   	}
> -
>   	ret = tcg2_platform_get_tpm2(&dev);
>   	if (ret != EFI_SUCCESS)
>   		goto out;
>
> -	EFI_ENTRY("%p, %p", this, active_pcr_banks);
>   	ret = tcg2_get_active_pcr_banks(dev, active_pcr_banks);
>
>   out:
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 7ada536568..dae1b166c8 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -949,16 +949,16 @@  efi_tcg2_get_active_pcr_banks(struct efi_tcg2_protocol *this,
 	struct udevice *dev;
 	efi_status_t ret;
 
+	EFI_ENTRY("%p, %p", this, active_pcr_banks);
+
 	if (!this || !active_pcr_banks) {
 		ret = EFI_INVALID_PARAMETER;
 		goto out;
 	}
-
 	ret = tcg2_platform_get_tpm2(&dev);
 	if (ret != EFI_SUCCESS)
 		goto out;
 
-	EFI_ENTRY("%p, %p", this, active_pcr_banks);
 	ret = tcg2_get_active_pcr_banks(dev, active_pcr_banks);
 
 out: