[PATCH] efi_loader: Uninstall the TCG2 protocol if logging s-crtm fails

Ilias Apalodimas ilias.apalodimas at linaro.org
Mon May 10 20:19:14 CEST 2021


Instead of just failing, clean up the installed config table and
EventLog memory if logging an s-crtm event fails during the protocol
installation

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

diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 570cc746ed4e..8f8a26e7b7ae 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -1113,7 +1113,7 @@ efi_status_t efi_tcg2_register(void)
 
 	ret = efi_append_scrtm_version(dev);
 	if (ret != EFI_SUCCESS)
-		goto out;
+		goto fail;
 
 	ret = efi_add_protocol(efi_root, &efi_guid_tcg2_protocol,
 			       (void *)&efi_tcg2_protocol);
-- 
2.31.0



More information about the U-Boot mailing list