public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM
@ 2018-05-16  1:35 Liming Gao
  2018-05-16  2:17 ` Zeng, Star
  0 siblings, 1 reply; 2+ messages in thread
From: Liming Gao @ 2018-05-16  1:35 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

The PEIM in all cached FV image may be in registered for shadow status.
Current logic CurrentPeimFvCount is not enough.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 027176d872..0ac3fdde6a 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -976,7 +976,7 @@ PeiDispatcher (
     SaveCurrentFvCount    = Private->CurrentPeimFvCount;
     SaveCurrentFileHandle =  Private->CurrentFileHandle;
 
-    for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {
+    for (Index1 = 0; Index1 < Private->FvCount; Index1++) {
       for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {
         if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISTER_FOR_SHADOW) {
           PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];
-- 
2.16.2.windows.1



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

* Re: [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM
  2018-05-16  1:35 [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM Liming Gao
@ 2018-05-16  2:17 ` Zeng, Star
  0 siblings, 0 replies; 2+ messages in thread
From: Zeng, Star @ 2018-05-16  2:17 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

Thanks,
Star
-----Original Message-----
From: Gao, Liming 
Sent: Wednesday, May 16, 2018 9:35 AM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM

The PEIM in all cached FV image may be in registered for shadow status.
Current logic CurrentPeimFvCount is not enough.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 027176d872..0ac3fdde6a 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -976,7 +976,7 @@ PeiDispatcher (
     SaveCurrentFvCount    = Private->CurrentPeimFvCount;
     SaveCurrentFileHandle =  Private->CurrentFileHandle;
 
-    for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {
+    for (Index1 = 0; Index1 < Private->FvCount; Index1++) {
       for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {
         if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISTER_FOR_SHADOW) {
           PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];
-- 
2.16.2.windows.1



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

end of thread, other threads:[~2018-05-16  2:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-16  1:35 [Patch] MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM Liming Gao
2018-05-16  2:17 ` Zeng, Star

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