2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 09:31:51 +00:00

[efi] Unload our own image before exiting UEFI application

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-03-14 15:56:36 +00:00
parent e662912c53
commit f618178e60

View File

@ -37,11 +37,16 @@ EFI_STATUS EFIAPI _efi_start ( EFI_HANDLE image_handle,
/* Initialise EFI environment */
if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
return efirc;
goto err_init;
/* Call to main() */
if ( ( rc = main() ) != 0 )
return EFIRC ( rc );
if ( ( rc = main() ) != 0 ) {
efirc = EFIRC ( rc );
goto err_main;
}
return 0;
err_main:
efi_loaded_image->Unload ( image_handle );
err_init:
return efirc;
}