diff options
author | Michael Brown | 2014-09-19 14:16:31 +0200 |
---|---|---|
committer | Michael Brown | 2014-09-19 14:22:04 +0200 |
commit | 5d9fbf34ee3f7a8b7b829de43115437400d1189f (patch) | |
tree | ff981fb65a401722b40fb6a26176d3fa16030651 | |
parent | [intel] Add I217-LM PCI ID (diff) | |
download | ipxe-5d9fbf34ee3f7a8b7b829de43115437400d1189f.tar.gz ipxe-5d9fbf34ee3f7a8b7b829de43115437400d1189f.tar.xz ipxe-5d9fbf34ee3f7a8b7b829de43115437400d1189f.zip |
[efi] Provide dummy device path in efi_image_probe()
Some UEFI platforms will fail the call to LoadImage() with
EFI_INVALID_PARAMETER if we do not provide a device path (even though
we are providing a non-NULL SourceBuffer).
Fix by providing an empty device path for the call to LoadImage() in
efi_image_probe().
The call to LoadImage() in efi_image_exec() already constructs and
provides a device path (based on the most recently opened SNP device),
and so does not require this fix.
Reported-by: NICOLAS CATTIE <nicolas.cattie@mpsa.com>
Tested-by: NICOLAS CATTIE <nicolas.cattie@mpsa.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/image/efi_image.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/image/efi_image.c b/src/image/efi_image.c index 83da9d9b..b7d8f9c6 100644 --- a/src/image/efi_image.c +++ b/src/image/efi_image.c @@ -280,12 +280,17 @@ static int efi_image_exec ( struct image *image ) { */ static int efi_image_probe ( struct image *image ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; + static EFI_DEVICE_PATH_PROTOCOL empty_path = { + .Type = END_DEVICE_PATH_TYPE, + .SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE, + .Length[0] = sizeof ( empty_path ), + }; EFI_HANDLE handle; EFI_STATUS efirc; int rc; /* Attempt loading image */ - if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, NULL, + if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, &empty_path, user_to_virt ( image->data, 0 ), image->len, &handle ) ) != 0 ) { /* Not an EFI image */ |