fix(core): add missing `if utils.USE_POWER_MANAGER`
What changed, and why it matters
This commit fixes a small coding mistake in the Trezor hardware wallet's startup code. The device was always trying to reset a power-management timer, even on models that don't have that feature. The fix adds a check so the reset only happens on models that actually support it. This is a defensive bug fix; the diff alone does not show a clear security vulnerability, but it could prevent a crash or unexpected behavior during boot on some device models.
Treat as a routine defensive fix. Review whether the missing guard could cause a boot failure or undefined behavior on builds with USE_POWER_MANAGER disabled, and consider adding a regression test for that configuration.
Security signals we found
Conditional gating added for power-management subsystem access
Boot-time code path modified
No changelog or security disclosure in commit message
Evidence from the diff
In core/src/boot.py, the bootscreen() coroutine unconditionally called workflow.idle_timer.clear() at the end of error handling. The fix wraps that call in if utils.USE_POWER_MANAGER:, matching how power-manager features are gated elsewhere. Without the guard, on builds where USE_POWER_MANAGER is false, the call may reference an unconfigured/unsupported subsystem. The patch is minimal (+2/-1) and does not include a changelog entry.
Changed components
core/src/boot.pybootscreen() coroutineworkflow.idle_timerutils.USE_POWER_MANAGER configurationInspect captured patch +2 / −1
diff --git a/core/src/boot.py b/core/src/boot.py
index 59ae0d32a..295325198 100644
--- a/core/src/boot.py
+++ b/core/src/boot.py
@@ -114,7 +114,8 @@ async def bootscreen() -> None:
log.exception(__name__, e)
utils.halt(e.__class__.__name__)
- workflow.idle_timer.clear()
+ if utils.USE_POWER_MANAGER:
+ workflow.idle_timer.clear()
loop.clear()
Why this scored 28/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.