diff mbox series

[v10,07/10] efi_loader: fix EFI_ENTRY point on get_active_pcr_banks

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

Commit Message

Eddie James Aug. 7, 2023, 3:17 p.m. UTC
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>

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

Comments

Ilias Apalodimas Aug. 7, 2023, 3:56 p.m. UTC | #1
Hi Eddie,

On Mon, 7 Aug 2023 at 18:17, Eddie James <eajames@linux.ibm.com> wrote:
>
> From: Ilias Apalodimas <ilias.apalodimas@linaro.org>

We need a commit message for that.  Something along the lines of
efi_tcg2_get_active_pcr_banks() doesnt immediately call the
EFI_ENTRY() wrappers once it enters the function.  Move the call a few
lines above and cover the error cases properly as well

Thanks
/Ilias
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
>  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 5f0f4b5dd2..829bae7436 100644
> --- a/lib/efi_loader/efi_tcg2.c
> +++ b/lib/efi_loader/efi_tcg2.c
> @@ -718,16 +718,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:
> --
> 2.39.3
>
Eddie James Aug. 7, 2023, 5:11 p.m. UTC | #2
On 8/7/23 10:56, Ilias Apalodimas wrote:
> Hi Eddie,
>
> On Mon, 7 Aug 2023 at 18:17, Eddie James <eajames@linux.ibm.com> wrote:
>> From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> We need a commit message for that.  Something along the lines of
> efi_tcg2_get_active_pcr_banks() doesnt immediately call the
> EFI_ENTRY() wrappers once it enters the function.  Move the call a few
> lines above and cover the error cases properly as well


Oops, yep. I'll fix this too.


Thanks,

Eddie


>
> Thanks
> /Ilias
>> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
>> ---
>>   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 5f0f4b5dd2..829bae7436 100644
>> --- a/lib/efi_loader/efi_tcg2.c
>> +++ b/lib/efi_loader/efi_tcg2.c
>> @@ -718,16 +718,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:
>> --
>> 2.39.3
>>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 5f0f4b5dd2..829bae7436 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -718,16 +718,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: