summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Universal/Acpi/S3Resume2Pei
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-06-30 15:17:58 +0800
committerStar Zeng <star.zeng@intel.com>2016-07-02 12:22:55 +0800
commit6f9760d88b11d3a848c2522286f3a5b5e5214fbd (patch)
treed8350404396cb372dbdbb18f6729a73c192c8c1b /UefiCpuPkg/Universal/Acpi/S3Resume2Pei
parent3b3593b567761d2568ea70c117c7111fd85e79b9 (diff)
downloadedk2-6f9760d88b11d3a848c2522286f3a5b5e5214fbd.tar.gz
edk2-6f9760d88b11d3a848c2522286f3a5b5e5214fbd.tar.bz2
edk2-6f9760d88b11d3a848c2522286f3a5b5e5214fbd.zip
UefiCpuPkg S3Resume2Pei: Report status code when allocate memory is failed
Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Diffstat (limited to 'UefiCpuPkg/Universal/Acpi/S3Resume2Pei')
-rw-r--r--UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index a79fc59bdf..0ccf3a42b5 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -4,7 +4,7 @@
This module will excute the boot script saved during last boot and after that,
control is passed to OS waking up handler.
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -822,7 +822,13 @@ S3ResumeExecuteBootScript (
// Make sure the newly allcated IDT align with 16-bytes
//
IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16));
- ASSERT (IdtBuffer != NULL);
+ if (IdtBuffer == NULL) {
+ REPORT_STATUS_CODE (
+ EFI_ERROR_CODE | EFI_ERROR_MAJOR,
+ (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_S3_RESUME_FAILED)
+ );
+ ASSERT (FALSE);
+ }
//
// Additional 16 bytes allocated to save IA32 IDT descriptor and Pei Service Table Pointer
// IA32 IDT descriptor will be used to setup IA32 IDT table for 32-bit Framework Boot Script code
@@ -852,7 +858,13 @@ S3ResumeExecuteBootScript (
// Prepare data for return back
//
PeiS3ResumeState = AllocatePool (sizeof(*PeiS3ResumeState));
- ASSERT (PeiS3ResumeState != NULL);
+ if (PeiS3ResumeState == NULL) {
+ REPORT_STATUS_CODE (
+ EFI_ERROR_CODE | EFI_ERROR_MAJOR,
+ (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_S3_RESUME_FAILED)
+ );
+ ASSERT (FALSE);
+ }
DEBUG (( EFI_D_ERROR, "PeiS3ResumeState - %x\r\n", PeiS3ResumeState));
PeiS3ResumeState->ReturnCs = 0x10;
PeiS3ResumeState->ReturnEntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)S3ResumeBootOs;