}
/* Attempt loading image */
+ handle = NULL;
if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, path,
user_to_virt ( image->data, 0 ),
image->len, &handle ) ) != 0 ) {
rc = -EEFI_LOAD ( efirc );
DBGC ( image, "EFIIMAGE %p could not load: %s\n",
image, strerror ( rc ) );
- goto err_load_image;
+ if ( efirc == EFI_SECURITY_VIOLATION ) {
+ goto err_load_image_security_violation;
+ } else {
+ goto err_load_image;
+ }
}
/* Get the loaded image protocol for the newly loaded image */
* call UnloadImage()). We therefore ignore any failures from
* the UnloadImage() call itself.
*/
+ err_load_image_security_violation:
if ( rc != 0 )
bs->UnloadImage ( handle );
err_load_image:
int rc;
/* Attempt loading image */
+ handle = NULL;
if ( ( efirc = bs->LoadImage ( FALSE, efi_image_handle, &empty_path,
user_to_virt ( image->data, 0 ),
image->len, &handle ) ) != 0 ) {
rc = -EEFI_LOAD ( efirc );
DBGC ( image, "EFIIMAGE %p could not load: %s\n",
image, strerror ( rc ) );
- return rc;
+ if ( efirc == EFI_SECURITY_VIOLATION ) {
+ goto err_load_image_security_violation;
+ } else {
+ goto err_load_image;
+ }
}
/* Unload the image. We can't leave it loaded, because we
bs->UnloadImage ( handle );
return 0;
+
+ err_load_image_security_violation:
+ bs->UnloadImage ( handle );
+ err_load_image:
+ return rc;
}
/** EFI image type */