public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool
@ 2019-06-12  4:50 Gao, Zhichao
  2019-06-12  8:33 ` [edk2-devel] " Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Gao, Zhichao @ 2019-06-12  4:50 UTC (permalink / raw)
  To: devel
  Cc: Bret Barkelew, Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao,
	Sean Brogan, Michael Turner

From: Bret Barkelew <Bret.Barkelew@microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901

The original logic is ASSERT if fail to create HOB. But
that doesn't make sense for release version. So it is required
to set the Buffer to null to indicate the failure.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index 42f79ab076..37b0cfa3cf 100644
--- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
+++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
@@ -802,7 +802,12 @@ PeiAllocatePool (
              (VOID **)&Hob
              );
   ASSERT_EFI_ERROR (Status);
-  *Buffer = Hob+1;
+
+  if (EFI_ERROR (Status)) {
+    *Buffer = NULL;
+  } else {
+    *Buffer = Hob+1;
+  }
 
   return Status;
 }
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-24  2:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-12  4:50 [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool Gao, Zhichao
2019-06-12  8:33 ` [edk2-devel] " Laszlo Ersek
2019-06-13  0:32   ` Gao, Zhichao
2019-06-18  5:14   ` Wu, Hao A
2019-06-18  5:16     ` Liming Gao
2019-06-24  2:20       ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox