[Concept,v2,16/22] efi: app: Print the final message before freeing memory

Message ID 20250819185900.835939-17-sjg@u-boot.org
State New
Headers
Series efi: Improvements for the EFI app on ARM |

Commit Message

Simon Glass Aug. 19, 2025, 6:58 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Printing may make use of tables which could go away when freed, so do
the free as the last thing before exiting the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 lib/efi_client/efi_app.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c
index 19a0032a784..3c78165adef 100644
--- a/lib/efi_client/efi_app.c
+++ b/lib/efi_client/efi_app.c
@@ -231,8 +231,8 @@  static void efi_exit(void)
 {
 	struct efi_priv *priv = efi_get_priv();
 
-	free_memory(priv);
 	printf("U-Boot EFI exiting\n");
+	free_memory(priv);
 	priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL);
 }