public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly
@ 2017-05-18  8:41 Star Zeng
  2017-05-19  2:05 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Star Zeng @ 2017-05-18  8:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Liming Gao

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly
  2017-05-18  8:41 [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly Star Zeng
@ 2017-05-19  2:05 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2017-05-19  2:05 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org; +Cc: Zeng, Star

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-19  2:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18  8:41 [PATCH] MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctly Star Zeng
2017-05-19  2:05 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox