]> git.sur5r.net Git - u-boot/commitdiff
efi_selftest: provide a dummy device path
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 18 Oct 2017 16:13:09 +0000 (18:13 +0200)
committerAlexander Graf <agraf@suse.de>
Fri, 1 Dec 2017 12:22:55 +0000 (13:22 +0100)
Currently we pass bootefi_device_path and bootefi_image_path as
device and image path without initializing them. They may carry
values from previous calls to bootefi.

With the patch the variables are initialized valid dummy values.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
cmd/bootefi.c

index 43ecdb953c0b96c2d6491a2e2f4a7d7d6e500385..4935173ce07784cc85e0f60cef766c324802c4c4 100644 (file)
@@ -299,6 +299,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                struct efi_loaded_image loaded_image_info = {};
                struct efi_object loaded_image_info_obj = {};
 
+               /* Construct a dummy device path. */
+               bootefi_device_path = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
+                                                     (uintptr_t)&efi_selftest,
+                                                     (uintptr_t)&efi_selftest);
+               bootefi_image_path = efi_dp_from_file(NULL, 0, "\\selftest");
+
                efi_setup_loaded_image(&loaded_image_info,
                                       &loaded_image_info_obj,
                                       bootefi_device_path, bootefi_image_path);