boot: bootflow: Ensure sel_id is initialised before use
PATCH 1/1 boot: bootflow: Ensure sel_id is initialised before use
sel_id is only assigned to in the case of EXPOACT_SELECT, anything else will leave sel_id uninitialised. Initialise it on declaration to ensure that it is always valid.
This issue was found with Smatch.
--- boot/bootflow_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/bootflow_menu.c +1 -1
@@ -182,7 +182,7 @@ int bootflow_menu_run(struct bootstd_priv *std, bool text_mode,struct bootflow *sel_bflow;struct udevice *dev;struct expo *exp; -uint sel_id; +uint sel_id =0 ;bool done;int ret;
---
base-commit: 7027b445cc0bfb86204ecb1f1fe596f5895048d9
change-id: 20250630-bootflow_menu_fix-4ea403f596dd
Best regards,
Signature · 1 line
Andrew Goodbody <[email protected]>
Quoted 10 lines · Andrew Goodbody
sel_idis only assigned to in the case ofEXPOACT_SELECT, anything else will leavesel_iduninitialised. Initialise it on declaration to ensure that it is always valid.This issue was found with Smatch.
Signed-off-by Andrew Goodbody <[email protected]>--- boot/bootflow_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Can you please rebase this on current master? Thanks.
Signature · 1 line
Tom
Quoted 6 lines · Tom Rini
Quoted 4 lines · Andrew Goodbody
sel_idis only assigned to in the case ofEXPOACT_SELECT, anything else will leavesel_iduninitialised. Initialise it on declaration to ensure that it is always valid.
Quoted 8 lines
Quoted 6 lines
This issue was found with Smatch.
Signed-off-by Andrew Goodbody <[email protected]>--- boot/bootflow_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Can you please rebase this on current master? Thanks.
The patch is no longer relevant with all the changes. Just drop it.
Andrew
Quoted 9 lines · Andrew Goodbody
Quoted 8 lines · Tom Rini
Quoted 6 lines · Andrew Goodbody
sel_idis only assigned to in the case ofEXPOACT_SELECT, anything else will leavesel_iduninitialised. Initialise it on declaration to ensure that it is always valid.This issue was found with Smatch.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Signed-off-by Andrew Goodbody <[email protected]>--- boot/bootflow_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Can you please rebase this on current master? Thanks.
The patch is no longer relevant with all the changes. Just drop it.
OK, thanks.
Signature · 1 line
Tom