From ba91d0292e593df8528b66f99c1b0b14fadc8e16 Mon Sep 17 00:00:00 2001 From: Wendy Liao Date: Wed, 3 May 2023 11:04:12 +0800 Subject: MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4438 The main dispatch loop in PeiDispatcher() goes through each FV and calls DiscoverPeimsAndOrderWithApriori() to search Apriori file to reorder all PEIMs then do the PEIM dispatched. DiscoverPeimsAndOrderWithApriori() calculates Apriori file count for every FV once and set Private->AprioriCount, but Private->AprioriCount doesn't be set to 0 before dispatch loop walking through the next FV. It causes the peim which sort on less than Private->AprioriCount and depex is not satisfied would be dispatched when dispatch loop go through to a scaned FV, even the peim is not set in APRIORI file. Cc: Leon Chen Cc: Tim Lewis Reported-by: Esther Lee Signed-off-by: Wendy Liao Reviewed-by: Liming Gao --- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 1 + 1 file changed, 1 insertion(+) (limited to 'MdeModulePkg/Core') diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index d8284f9..5f32ebb 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -1630,6 +1630,7 @@ PeiDispatcher ( Private->CurrentFileHandle = NULL; Private->CurrentPeimCount = 0; Private->CurrentFvFileHandles = NULL; + Private->AprioriCount = 0; } // -- cgit v1.1