david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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
1 changed files with 9 additions and 4 deletions

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