diff options
author | Michael Brown <mcb30@ipxe.org> | 2020-06-05 09:40:36 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2020-06-05 09:44:22 +0100 |
commit | ac28bbb7ea3a1c88aa47c086e92fab78a75c351d (patch) | |
tree | 12f7398f9bef5c70b8c559cd63c4922b3eaaa0b1 /src/interface/efi/efi_block.c | |
parent | 18d2162f642fb0e879d5188e7d319add3744b85b (diff) | |
download | ipxe-ac28bbb7ea3a1c88aa47c086e92fab78a75c351d.tar.gz |
[efi] Work around UEFI specification bug in LoadImage for SAN boot
As described in the previous commit, work around a UEFI specification
bug that necessitates calling UnloadImage if the return value from
LoadImage is EFI_SECURITY_VIOLATION.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_block.c')
-rw-r--r-- | src/interface/efi/efi_block.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/interface/efi/efi_block.c b/src/interface/efi/efi_block.c index 91f830a11..64d1e1980 100644 --- a/src/interface/efi/efi_block.c +++ b/src/interface/efi/efi_block.c @@ -594,11 +594,14 @@ static int efi_block_boot_image ( struct san_device *sandev, EFI_HANDLE handle, sandev->drive, efi_devpath_text ( boot_path ) ); /* Try loading boot image from this device */ + *image = NULL; if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, boot_path, NULL, 0, image ) ) != 0 ) { rc = -EEFI ( efirc ); DBGC ( sandev, "EFIBLK %#02x could not load image: %s\n", sandev->drive, strerror ( rc ) ); + if ( efirc == EFI_SECURITY_VIOLATION ) + bs->UnloadImage ( *image ); goto err_load_image; } |