summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiHobLib/HobLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiHobLib/HobLib.c')
-rw-r--r--MdePkg/Library/PeiHobLib/HobLib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c
index 380a735..1f0c66a 100644
--- a/MdePkg/Library/PeiHobLib/HobLib.c
+++ b/MdePkg/Library/PeiHobLib/HobLib.c
@@ -275,7 +275,7 @@ BuildResourceDescriptorHob (
for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
If Guid is NULL, then ASSERT().
If there is no additional space for HOB creation, then ASSERT().
- If DataLength > (0x10000 - sizeof (EFI_HOB_TYPE_GUID)), then ASSERT().
+ If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
@param Guid The GUID to tag the customized HOB.
@param DataLength The size of the data payload for the GUID HOB.
@@ -313,7 +313,7 @@ BuildGuidHob (
If Guid is NULL, then ASSERT().
If Data is NULL and DataLength > 0, then ASSERT().
If there is no additional space for HOB creation, then ASSERT().
- If DataLength > (0x10000 - sizeof (EFI_HOB_TYPE_GUID)), then ASSERT().
+ If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
@param Guid The GUID to tag the customized HOB.
@param Data The data to be copied into the data field of the GUID HOB.
@@ -332,6 +332,8 @@ BuildGuidDataHob (
{
VOID *HobData;
+ ASSERT (Data != NULL || DataLength == 0);
+
HobData = BuildGuidHob (Guid, DataLength);
return CopyMem (HobData, Data, DataLength);