Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 4cd5d77

Browse files
author
leo
committed
host: call LoadImage with parent handle and init child handle
Initialize the child image suppress the following valgrind errors: ==17180== Conditional jump or move depends on uninitialised value(s) ==17180== at 0x1169C8: install_protocol_interface (protocol.c:62) ==17180== by 0x115891: interface_init (interface.c:51) ==17180== by 0x110A5E: load_image (image.c:69) ==17180== by 0x10BCE9: load_and_execute (main.c:193) ==17180== by 0x10C3EA: main (main.c:374) ==17180== Uninitialised value was created by a stack allocation ==17180== at 0x10BC74: load_and_execute (main.c:181) Signed-off-by: leo <[email protected]>
1 parent 4021df3 commit 4cd5d77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

host/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static EFI_STATUS load_and_execute(const char *path,
181181
{
182182
EFI_STATUS ret;
183183
EFI_RESET_SYSTEM saved_reset_rs;
184-
EFI_HANDLE image;
184+
EFI_HANDLE image = NULL;
185185
void *data;
186186
UINTN size;
187187
int setjmpret;
@@ -191,7 +191,7 @@ static EFI_STATUS load_and_execute(const char *path,
191191
return ret;
192192

193193
ret = uefi_call_wrapper(st->BootServices->LoadImage, 6,
194-
FALSE, image, NULL,
194+
FALSE, parent, NULL,
195195
data, size, &image);
196196
free(data);
197197
if (EFI_ERROR(ret)) {

0 commit comments

Comments
 (0)