[efi] Unload our own image before exiting UEFI application
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
e662912c53
commit
f618178e60
@ -37,11 +37,16 @@ EFI_STATUS EFIAPI _efi_start ( EFI_HANDLE image_handle,
|
|||||||
|
|
||||||
/* Initialise EFI environment */
|
/* Initialise EFI environment */
|
||||||
if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
|
if ( ( efirc = efi_init ( image_handle, systab ) ) != 0 )
|
||||||
return efirc;
|
goto err_init;
|
||||||
|
|
||||||
/* Call to main() */
|
/* Call to main() */
|
||||||
if ( ( rc = main() ) != 0 )
|
if ( ( rc = main() ) != 0 ) {
|
||||||
return EFIRC ( rc );
|
efirc = EFIRC ( rc );
|
||||||
|
goto err_main;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
err_main:
|
||||||
|
efi_loaded_image->Unload ( image_handle );
|
||||||
|
err_init:
|
||||||
|
return efirc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user