]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: terminate efidebug test bootmgr early on error
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 20 Apr 2024 14:06:16 +0000 (16:06 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 1 May 2024 05:37:37 +0000 (07:37 +0200)
If efi_bootmgr_load() fails, there is no point in trying to start an image
that has not been loaded.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
cmd/efidebug.c

index d1f86e76e097ab83bba6c66018c03e432fc515c9..c2c525f2351744ce44f46ac47768505dc84b08c3 100644 (file)
@@ -1397,6 +1397,8 @@ static __maybe_unused int do_efi_test_bootmgr(struct cmd_tbl *cmdtp, int flag,
 
        ret = efi_bootmgr_load(&image, &load_options);
        printf("efi_bootmgr_load() returned: %ld\n", ret & ~EFI_ERROR_MASK);
+       if (ret != EFI_SUCCESS)
+               return CMD_RET_SUCCESS;
 
        /* We call efi_start_image() even if error for test purpose. */
        ret = EFI_CALL(efi_start_image(image, &exit_data_size, &exit_data));