[PATCH] state: guard against empty variable set in DT

Sascha Hauer s.hauer at pengutronix.de
Tue Nov 4 00:34:12 PST 2025


On Mon, 03 Nov 2025 12:16:23 +0100, Ahmad Fatoum wrote:
> We always initialize state->variables, but there are two places in the
> code that assume there is at least one entry already.
> 
> Change them to use list_first_entry_or_null/list_last_entry_or_null as
> appropriate to catch this issue gracefully.
> 
> This should have only affected state nodes without children, which is
> not a useful device tree description, but nevertheless we should handle
> that somehow instead of reading uninitialized values that may trigger
> a panic or other misbehavior.
> 
> [...]

Applied, thanks!

[1/1] state: guard against empty variable set in DT
      https://git.pengutronix.de/cgit/barebox/commit/?id=f1b549a97e50 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer at pengutronix.de>




More information about the barebox mailing list