diff mbox series

[U-Boot,v3,07/18] efi_selftest: provide a dummy device path

Message ID 20171017220244.8549-8-xypron.glpk@gmx.de
State Superseded, archived
Headers show
Series efi_loader: implement SetWatchdogTimer | expand

Commit Message

Heinrich Schuchardt Oct. 17, 2017, 10:02 p.m. UTC
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>
---
v3
	new patch split off
---
 cmd/bootefi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Simon Glass Oct. 22, 2017, 2:35 p.m. UTC | #1
On 18 October 2017 at 00:02, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> 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.

*to* valid

>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> v3
>         new patch split off
> ---
>  cmd/bootefi.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 59696f4601..d497381ac3 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -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);