summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}