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:
committed by
oliviermartin
parent
5223c12135
commit
d9c7741d4f
@ -1379,6 +1379,7 @@ InternalShellExecuteDevicePath(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
EFI_STATUS CleanupStatus;
|
||||||
EFI_HANDLE NewHandle;
|
EFI_HANDLE NewHandle;
|
||||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
||||||
LIST_ENTRY OrigEnvs;
|
LIST_ENTRY OrigEnvs;
|
||||||
@ -1473,18 +1474,29 @@ InternalShellExecuteDevicePath(
|
|||||||
// Cleanup (and dont overwrite errors)
|
// Cleanup (and dont overwrite errors)
|
||||||
//
|
//
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
gBS->UninstallProtocolInterface(NewHandle, &gEfiShellParametersProtocolGuid, &ShellParamsProtocol);
|
CleanupStatus = gBS->UninstallProtocolInterface(
|
||||||
|
NewHandle,
|
||||||
|
&gEfiShellParametersProtocolGuid,
|
||||||
|
&ShellParamsProtocol
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR(CleanupStatus);
|
||||||
} else {
|
} else {
|
||||||
Status = gBS->UninstallProtocolInterface(NewHandle, &gEfiShellParametersProtocolGuid, &ShellParamsProtocol);
|
CleanupStatus = gBS->UninstallProtocolInterface(
|
||||||
ASSERT_EFI_ERROR(Status);
|
NewHandle,
|
||||||
|
&gEfiShellParametersProtocolGuid,
|
||||||
|
&ShellParamsProtocol
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR(CleanupStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsListEmpty(&OrigEnvs)) {
|
if (!IsListEmpty(&OrigEnvs)) {
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
SetEnvironmentVariableList(&OrigEnvs);
|
CleanupStatus = SetEnvironmentVariableList(&OrigEnvs);
|
||||||
|
ASSERT_EFI_ERROR(CleanupStatus);
|
||||||
} else {
|
} else {
|
||||||
Status = SetEnvironmentVariableList(&OrigEnvs);
|
CleanupStatus = SetEnvironmentVariableList(&OrigEnvs);
|
||||||
|
ASSERT_EFI_ERROR (CleanupStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user