summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-12-26 12:49:09 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-02-16 15:42:20 +0100
commit8f7e2b2980a2d964db60a19a5d2ef8532caddf7d (patch)
tree08140cfb6de91b29c1a5ff58da9c6587736b1498 /lib/efi_loader/efi_boottime.c
parent0e18f584de59a86aaf86bd328dbd16fbd0175b3d (diff)
efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage(). Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index b1c0007e5a3..155cdc5a239 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1738,11 +1738,9 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,
ret = efi_setup_loaded_image(dp, fp, image_obj, &info);
if (ret != EFI_SUCCESS)
goto error_invalid_image;
- (*image_obj)->entry = efi_load_pe(*image_obj, source_buffer, info);
- if (!(*image_obj)->entry) {
- ret = EFI_UNSUPPORTED;
+ ret = efi_load_pe(*image_obj, source_buffer, info);
+ if (ret != EFI_SUCCESS)
goto error_invalid_image;
- }
/* Update the type of the allocated memory */
efi_add_memory_map((uintptr_t)source_buffer,
efi_size_in_pages(source_size),