summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/PeiPcdLib/PeiPcdLib.c')
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
index bee5386097..b8a53185bd 100644
--- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
+++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
@@ -586,7 +586,6 @@ LibPcdSetPtr (
{
EFI_STATUS Status;
PCD_PPI *PcdPpi;
- UINTN Size;
ASSERT (SizeOfBuffer != NULL);
@@ -596,17 +595,12 @@ LibPcdSetPtr (
PcdPpi = GetPcdPpiPtr ();
- Size = LibPcdGetSize (TokenNumber);
-
- if (*SizeOfBuffer > Size) {
- *SizeOfBuffer = Size;
+ Status = PcdPpi->SetPtr (TokenNumber, SizeOfBuffer, Buffer);
+
+ if (EFI_ERROR (Status)) {
return NULL;
}
- Status = PcdPpi->SetPtr (TokenNumber, *SizeOfBuffer, Buffer);
-
- ASSERT_EFI_ERROR (Status);
-
return Buffer;
}
@@ -817,7 +811,6 @@ LibPcdSetExPtr (
{
EFI_STATUS Status;
PCD_PPI *PcdPpi;
- UINTN Size;
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
@@ -825,16 +818,12 @@ LibPcdSetExPtr (
PcdPpi = GetPcdPpiPtr ();
- Size = LibPcdGetExSize (Guid, TokenNumber);
- if (*SizeOfBuffer > Size) {
- *SizeOfBuffer = Size;
+ Status = PcdPpi->SetPtrEx (Guid, TokenNumber, SizeOfBuffer, Buffer);
+
+ if (EFI_ERROR (Status)) {
return NULL;
}
- Status = PcdPpi->SetPtrEx (Guid, TokenNumber, *SizeOfBuffer, Buffer);
-
- ASSERT_EFI_ERROR (Status);
-
return Buffer;
}