[Concept,21/33] boot: cedit: Leave manual-sync off with exit without save

Message ID 20260416023021.626949-22-sjg@u-boot.org
State New
Headers
Series Fix memory leaks and test pollution in sandbox tests |

Commit Message

Simon Glass April 16, 2026, 2:29 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

cedit_run() calls expo_enter_mode() which sets video_set_manual_sync()
to true, pairing with expo_exit_mode() which clears it again.

Error paths inside the loop call expo_exit_mode() before returning,
but the normal exit (exp->done becoming true) falls through to the
bottom of the function and skips it, so when the user quits without
saving we return -EACCES with manual-sync still active.

Any later code that relies on video_sync() to copy fb to copy_fb then
silently does nothing. The dm_test_video_silence test sees this as
fb != copy_fb after its own video_sync and fails, purely because an
earlier test exercised cedit.

Call expo_exit_mode() once the loop has finished, before evaluating
the save/return paths, so the sync flag is always restored.

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

 boot/cedit.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/boot/cedit.c b/boot/cedit.c
index f047849e19d..7dc369008ee 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -268,6 +268,8 @@  int cedit_run(struct expo *exp)
 		}
 	} while (!exp->done);
 
+	expo_exit_mode(exp);
+
 	if (ret)
 		return log_msg_ret("end", ret);
 	if (!exp->save)