Skip to content

Commit

Permalink
Core/Dxe/Image: Fixed error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed Nov 20, 2023
1 parent 8955664 commit 1cdfde2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions MdeModulePkg/Core/Dxe/Image/Image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,13 +1238,12 @@ CoreLoadImageCommon (
UEFI_IMAGE_SOURCE_FV,
ImageOrigin
);
if (Status == EFI_NOT_STARTED) {
goto Done;
}

if (EFI_ERROR (Status)) {
CpuDeadLoop ();
return Status; ///< Should be unreachable.
if ((ImageOrigin != UefiImageOriginUserImage) && (Status != EFI_NOT_STARTED)) {
CpuDeadLoop ();
}

goto Done;
}

// FIXME: Context
Expand Down Expand Up @@ -1304,8 +1303,11 @@ CoreLoadImageCommon (

Status = UefiImageInitializeContextPostHash (&ImageContext);
if (EFI_ERROR (Status)) {
CpuDeadLoop ();
return Status; ///< Should be unreachable.
if (ImageOrigin != UefiImageOriginUserImage) {
CpuDeadLoop ();
}

goto Done;
}

//
Expand Down

0 comments on commit 1cdfde2

Please sign in to comment.