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
This commit is contained in:
Brendan Jackman 2014-01-24 22:28:36 +00:00 committed by oliviermartin
parent 5223c12135
commit d9c7741d4f
1 changed files with 17 additions and 5 deletions

View File

@ -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);
}
}