[PATCH 1/1] sandbox: fix sandbox_reset()

Heinrich Schuchardt xypron.glpk at gmx.de
Wed May 12 18:38:51 CEST 2021


state_uninit() and dm_uninit() are mutually exclusive:

state_uninit() prints via drivers. So it cannot be executed after
dm_uninit().

dm_uninit() requires memory. So it cannot be executed after state_uninit()
which releases all memory.

Just skip dm_uninit() when resetting the sandbox. We will wake up in a new
process and allocate new memory. So this cleanup is not required. We don't
do it in sandbox_exit() either.

This avoids a segmentation error when efi_reset_system_boottime() is
invoked by a UEFI application.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 arch/sandbox/cpu/start.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index e87365e800..4ffd97ccbc 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -425,9 +425,6 @@ void sandbox_reset(void)
 	if (state_uninit())
 		os_exit(2);

-	if (dm_uninit())
-		os_exit(2);
-
 	/* Restart U-Boot */
 	os_relaunch(os_argv);
 }
--
2.30.2



More information about the U-Boot mailing list