]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: superfluous efi_restore_gd after EFI_CALL
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 19 Apr 2024 09:59:01 +0000 (11:59 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 1 May 2024 05:37:32 +0000 (07:37 +0200)
EFI_CALL() invokes __efi_entry_check() which executes set_gd(efi_gd).
There is no need to execute set_gd(efi_gd) again via efi_restore_gd().

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

index 578dbb19a7e5e5f8c583ca07f53900018ba77968..c1454ffb9488343175c6693684d23ed3a1db0182 100644 (file)
@@ -107,7 +107,6 @@ static int do_efi_selftest(void)
 
        /* Execute the test */
        ret = EFI_CALL(efi_selftest(&image_obj->header, &systab));
-       efi_restore_gd();
        free(loaded_image_info->load_options);
        efi_free_pool(test_device_path);
        efi_free_pool(test_image_path);
index a587860e2a532f55d4f982daed4eaf78a89faee6..d1f86e76e097ab83bba6c66018c03e432fc515c9 100644 (file)
@@ -1404,8 +1404,6 @@ static __maybe_unused int do_efi_test_bootmgr(struct cmd_tbl *cmdtp, int flag,
        if (ret && exit_data)
                efi_free_pool(exit_data);
 
-       efi_restore_gd();
-
        free(load_options);
        return CMD_RET_SUCCESS;
 }
index 6918fd5e48ad39eb6a3d01a08f06cb7dd13d56fa..9d7f82f45220542be86c2343cffad44ff76fb2c5 100644 (file)
@@ -544,8 +544,6 @@ efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
                }
        }
 
-       efi_restore_gd();
-
 out:
        free(load_options);