From: Michael Brown Date: Fri, 14 Mar 2014 15:56:36 +0000 (+0000) Subject: [efi] Unload our own image before exiting UEFI application X-Git-Tag: v1.20.1~1251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f618178e60702c0ccb2501976bad36d483134938;p=thirdparty%2Fipxe.git [efi] Unload our own image before exiting UEFI application Signed-off-by: Michael Brown --- diff --git a/src/arch/x86/prefix/efiprefix.c b/src/arch/x86/prefix/efiprefix.c index 475ea505c..eb8aa738a 100644 --- a/src/arch/x86/prefix/efiprefix.c +++ b/src/arch/x86/prefix/efiprefix.c @@ -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; }