bootstd: Fix bootflow info for efi_mgr

A "Synchronous Abort" CPU exception happens on an attempt to run the
"bootflow info" command for a global boot method (e.g. efi_mgr):

    => bootflow select 0
    => bootflow info

    "Synchronous Abort" handler, esr 0x96000006, far 0x8

It happens because do_bootflow_info() tries to dereference bflow->dev,
which is NULL in case of efi_mgr. Add the corresponding check to prevent
this NULL pointer dereference and make "bootflow info" command work
properly for global boot methods.

Fixes: 2d653f686b ("bootstd: Add a bootflow command")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
This commit is contained in:
Sam Protsenko
2025-10-13 14:54:33 -06:00
committed by Tom Rini
parent ee7d07f9d0
commit 3b278dd9e6
+1 -1
View File
@@ -404,7 +404,7 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc,
}
printf("Name: %s\n", bflow->name);
printf("Device: %s\n", bflow->dev->name);
printf("Device: %s\n", bflow->dev ? bflow->dev->name : "(none)");
printf("Block dev: %s\n", bflow->blk ? bflow->blk->name : "(none)");
printf("Method: %s\n", bflow->method->name);
printf("State: %s\n", bootflow_state_get_name(bflow->state));