MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails
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: 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> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user