]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - cmd/bootefi.c
efi_selftest: correctly cleanup after selftest
[thirdparty/u-boot.git] / cmd / bootefi.c
index b894403ff6777132327bcb3230cece53c0093fc8..0915192bbb7368a9ee82db200c15e62df0f64d02 100644 (file)
@@ -349,8 +349,10 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                set_load_options(&loaded_image_info, "efi_selftest");
                /* Execute the test */
                r = efi_selftest(&loaded_image_info, &systab);
+               efi_restore_gd();
                free(loaded_image_info.load_options);
-               return r;
+               list_del(&loaded_image_info_obj.link);
+               return r != EFI_SUCCESS;
        } else
 #endif
        if (!strcmp(argv[1], "bootmgr")) {