[Concept,03/20] efi: app: Avoid freeing memory on exit

Message ID 20250828020732.981415-4-sjg@u-boot.org
State New
Headers
Series efi: App and devicetree improvements |

Commit Message

Simon Glass Aug. 28, 2025, 2:07 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

The private data is used to perform the exit, so freeing anything used
by the app may cause a hang or crash. The underlying EFI system should
be able to free any memory allocated by the app, so just skip the call
to free_memory()

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

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

Patch

diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c
index 7c9c156e006..f67973dbb85 100644
--- a/lib/efi_client/efi_app.c
+++ b/lib/efi_client/efi_app.c
@@ -245,7 +245,6 @@  static void efi_exit(void)
 	struct efi_priv *priv = efi_get_priv();
 
 	printf("U-Boot EFI exiting\n");
-	free_memory(priv);
 	priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL);
 }