From d9c7741d4f1787f8f370faab7432a86f63bdc611 Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Fri, 24 Jan 2014 22:28:36 +0000 Subject: ShellPkg/ShellProtocol.c: Don't overwrite Status in InternalShellExecuteDevicePath Due to the ASSERT_EFI_ERROR, this patch is necessary only to ensure specified behaviour in RELEASE builds. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brendan Jackman Reviewed-by: Olivier Martin Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15181 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/ShellProtocol.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'ShellPkg/Application/Shell') diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index 7f5884f90b..0d3839783e 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -1379,6 +1379,7 @@ InternalShellExecuteDevicePath( ) { EFI_STATUS Status; + EFI_STATUS CleanupStatus; EFI_HANDLE NewHandle; EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; LIST_ENTRY OrigEnvs; @@ -1473,18 +1474,29 @@ InternalShellExecuteDevicePath( // Cleanup (and dont overwrite errors) // if (EFI_ERROR(Status)) { - gBS->UninstallProtocolInterface(NewHandle, &gEfiShellParametersProtocolGuid, &ShellParamsProtocol); + CleanupStatus = gBS->UninstallProtocolInterface( + NewHandle, + &gEfiShellParametersProtocolGuid, + &ShellParamsProtocol + ); + ASSERT_EFI_ERROR(CleanupStatus); } else { - Status = gBS->UninstallProtocolInterface(NewHandle, &gEfiShellParametersProtocolGuid, &ShellParamsProtocol); - ASSERT_EFI_ERROR(Status); + CleanupStatus = gBS->UninstallProtocolInterface( + NewHandle, + &gEfiShellParametersProtocolGuid, + &ShellParamsProtocol + ); + ASSERT_EFI_ERROR(CleanupStatus); } } if (!IsListEmpty(&OrigEnvs)) { if (EFI_ERROR(Status)) { - SetEnvironmentVariableList(&OrigEnvs); + CleanupStatus = SetEnvironmentVariableList(&OrigEnvs); + ASSERT_EFI_ERROR(CleanupStatus); } else { - Status = SetEnvironmentVariableList(&OrigEnvs); + CleanupStatus = SetEnvironmentVariableList(&OrigEnvs); + ASSERT_EFI_ERROR (CleanupStatus); } } -- cgit v1.2.3