diff mbox series

efi_loader: Clean up tcg2 once in case of failure

Message ID 20210510181509.233610-1-ilias.apalodimas@linaro.org
State Accepted
Commit b76edf6b0753ada33d1ae486c621f5284d034055
Headers show
Series efi_loader: Clean up tcg2 once in case of failure | expand

Commit Message

Ilias Apalodimas May 10, 2021, 6:15 p.m. UTC
efi_init_event_log() calls tcg2_uninit() in case of failure.
We can skip that since the function is called on efi_tcg2_register()
which also cleans up if an error occurs

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

---
 lib/efi_loader/efi_tcg2.c | 4 ----
 1 file changed, 4 deletions(-)

-- 
2.31.0

Comments

Heinrich Schuchardt May 11, 2021, 6:27 a.m. UTC | #1
On 5/10/21 8:15 PM, Ilias Apalodimas wrote:
> efi_init_event_log() calls tcg2_uninit() in case of failure.

> We can skip that since the function is called on efi_tcg2_register()

> which also cleans up if an error occurs

>

> 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, 4 deletions(-)

>

> diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c

> index 94e8f22bbb69..570cc746ed4e 100644

> --- a/lib/efi_loader/efi_tcg2.c

> +++ b/lib/efi_loader/efi_tcg2.c

> @@ -1053,12 +1053,8 @@ static efi_status_t efi_init_event_log(void)

>   	event_log.last_event_size = event_log.pos;

>

>   	ret = create_final_event();

> -	if (ret != EFI_SUCCESS)

> -		goto out;

>

> -	return EFI_SUCCESS;

>   out:

> -	tcg2_uninit();

>   	return ret;

>   }

>

>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 94e8f22bbb69..570cc746ed4e 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -1053,12 +1053,8 @@  static efi_status_t efi_init_event_log(void)
 	event_log.last_event_size = event_log.pos;
 
 	ret = create_final_event();
-	if (ret != EFI_SUCCESS)
-		goto out;
 
-	return EFI_SUCCESS;
 out:
-	tcg2_uninit();
 	return ret;
 }