diff mbox series

[1/1] efi_loader: avoid writing message in Exit() boot service

Message ID 20241126234017.29814-1-heinrich.schuchardt@canonical.com
State Accepted, archived
Delegated to: Heinrich Schuchardt
Headers show
Series [1/1] efi_loader: avoid writing message in Exit() boot service | expand

Commit Message

Heinrich Schuchardt Nov. 26, 2024, 11:40 p.m. UTC
We should not write messages in UEFI API functions. This may lead to
incorrect screen layout in UEFI application.

For single statements after if clause we don't need braces.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 lib/efi_loader/efi_boottime.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Ilias Apalodimas Nov. 28, 2024, 10:46 a.m. UTC | #1
On Wed, 27 Nov 2024 at 01:40, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> We should not write messages in UEFI API functions. This may lead to
> incorrect screen layout in UEFI application.
>
> For single statements after if clause we don't need braces.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  lib/efi_loader/efi_boottime.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 080e7f78ae3..38b0af9d502 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -3495,10 +3495,9 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
>         if (IS_ENABLED(CONFIG_EFI_TCG2_PROTOCOL)) {
>                 if (image_obj->image_type == IMAGE_SUBSYSTEM_EFI_APPLICATION) {
>                         ret = efi_tcg2_measure_efi_app_exit();
> -                       if (ret != EFI_SUCCESS) {
> -                               log_warning("tcg2 measurement fails(0x%lx)\n",
> -                                           ret);
> -                       }
> +                       if (ret != EFI_SUCCESS)
> +                               log_debug("tcg2 measurement fails (0x%lx)\n",
> +                                         ret);
>                 }
>         }
>
> --
> 2.45.2
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 080e7f78ae3..38b0af9d502 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -3495,10 +3495,9 @@  static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
 	if (IS_ENABLED(CONFIG_EFI_TCG2_PROTOCOL)) {
 		if (image_obj->image_type == IMAGE_SUBSYSTEM_EFI_APPLICATION) {
 			ret = efi_tcg2_measure_efi_app_exit();
-			if (ret != EFI_SUCCESS) {
-				log_warning("tcg2 measurement fails(0x%lx)\n",
-					    ret);
-			}
+			if (ret != EFI_SUCCESS)
+				log_debug("tcg2 measurement fails (0x%lx)\n",
+					  ret);
 		}
 	}