[edk2] [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly

Star Zeng posted 1 patch 7 years, 7 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 1 +
1 file changed, 1 insertion(+)
[edk2] [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly
Posted by Star Zeng 7 years, 7 months ago
When DynamicEx PCD is only used in PEI code, but not DXE code,
current implementation of DxePcdGetNextTokenSpace does not assign
TmpTokenSpaceBufferCount correctly, but leaves it as initial value,
then DxePcdGetNextTokenSpace may return incorrect token space guid
and status.

This patch is to fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
index 9d710bbf1fb7..326644c53105 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
@@ -1296,6 +1296,7 @@ DxePcdGetNextTokenSpace (
                             (EFI_GUID *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->GuidTableOffset)
                             );
       CopyMem (TmpTokenSpaceBuffer, PeiTokenSpaceTable, sizeof (EFI_GUID*) * PeiTokenSpaceTableSize);
+      TmpTokenSpaceBufferCount = PeiTokenSpaceTableSize;
       FreePool (PeiTokenSpaceTable);
     }
 
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly
Posted by Gao, Liming 7 years, 7 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Star
>Zeng
>Sent: Thursday, May 18, 2017 4:41 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>
>Subject: [edk2] [PATCH] MdeModulePkg PCD: Fix
>TmpTokenSpaceBufferCount not assigned correctly
>
>When DynamicEx PCD is only used in PEI code, but not DXE code,
>current implementation of DxePcdGetNextTokenSpace does not assign
>TmpTokenSpaceBufferCount correctly, but leaves it as initial value,
>then DxePcdGetNextTokenSpace may return incorrect token space guid
>and status.
>
>This patch is to fix this issue.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Star Zeng <star.zeng@intel.com>
>---
> MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
>b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
>index 9d710bbf1fb7..326644c53105 100644
>--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
>+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
>@@ -1296,6 +1296,7 @@ DxePcdGetNextTokenSpace (
>                             (EFI_GUID *)((UINT8 *)mPcdDatabase.PeiDb +
>mPcdDatabase.PeiDb->GuidTableOffset)
>                             );
>       CopyMem (TmpTokenSpaceBuffer, PeiTokenSpaceTable, sizeof
>(EFI_GUID*) * PeiTokenSpaceTableSize);
>+      TmpTokenSpaceBufferCount = PeiTokenSpaceTableSize;
>       FreePool (PeiTokenSpaceTable);
>     }
>
>--
>2.7.0.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel