From: Star Zeng Date: Fri, 31 Oct 2014 07:20:26 +0000 (+0000) Subject: MdePkg/IntelFrameworkPkg HobLib: Update BuildResourceDescriptorWithOwnerHob() X-Git-Tag: edk2-stable201903~10731 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a75cf433d167aba7674e4b230f59ee915ebe64a8;p=mirror_edk2.git MdePkg/IntelFrameworkPkg HobLib: Update BuildResourceDescriptorWithOwnerHob() to align the behavior of BuildResourceDescriptorHob(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16279 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c b/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c index c4c14f9ae3..898d07b6ff 100644 --- a/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c +++ b/IntelFrameworkPkg/Library/PeiHobLibFramework/HobLib.c @@ -331,10 +331,11 @@ BuildResourceDescriptorWithOwnerHob ( ) { EFI_HOB_RESOURCE_DESCRIPTOR *Hob; - EFI_STATUS Status; - - Status = PeiServicesCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, sizeof (EFI_HOB_RESOURCE_DESCRIPTOR), (void **)&Hob); - ASSERT_EFI_ERROR (Status); + + Hob = InternalPeiCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, (UINT16) sizeof (EFI_HOB_RESOURCE_DESCRIPTOR)); + if (Hob == NULL) { + return; + } Hob->ResourceType = ResourceType; Hob->ResourceAttribute = ResourceAttribute; diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c index a608325c65..f853452f56 100644 --- a/MdePkg/Library/PeiHobLib/HobLib.c +++ b/MdePkg/Library/PeiHobLib/HobLib.c @@ -327,10 +327,11 @@ BuildResourceDescriptorWithOwnerHob ( ) { EFI_HOB_RESOURCE_DESCRIPTOR *Hob; - EFI_STATUS Status; - - Status = PeiServicesCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, sizeof (EFI_HOB_RESOURCE_DESCRIPTOR), (void **)&Hob); - ASSERT_EFI_ERROR (Status); + + Hob = InternalPeiCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, (UINT16) sizeof (EFI_HOB_RESOURCE_DESCRIPTOR)); + if (Hob == NULL) { + return; + } Hob->ResourceType = ResourceType; Hob->ResourceAttribute = ResourceAttribute;