summaryrefslogtreecommitdiff
path: root/ShellPkg/Application/Shell
diff options
context:
space:
mode:
authorBrendan Jackman <Brendan.Jackman@arm.com>2014-01-24 22:28:36 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-24 22:28:36 +0000
commitd9c7741d4f1787f8f370faab7432a86f63bdc611 (patch)
treeb27df4e14532e3b75b7debd9d802cfe99f204afc /ShellPkg/Application/Shell
parent5223c1213506f3a8f3c120a6620258d2b071db84 (diff)
downloadedk2-platforms-d9c7741d4f1787f8f370faab7432a86f63bdc611.tar.xz
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 <Brendan.Jackman@arm.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15181 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application/Shell')
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c22
1 files changed, 17 insertions, 5 deletions
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);
}
}