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>
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;
}