Skip to content

Commit

Permalink
MdePkg/SmmPciExpressLib: Ensure gBS variable for the constructor
Browse files Browse the repository at this point in the history
The PCD token, PcdPciExpressBaseAddress is referred in the constructor.
If the token is defined as PcdsDynamic type, the PCD function that gets
the token value uses the gBS service to locate PCD protocol internally.
In this case, it is possible for the function to be called before
initializing gBS variable, then cause a system hang due to gBS variable.
Need to ensure the availability of gBS variable.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
  • Loading branch information
philnoh2 authored and mergify[bot] committed Nov 22, 2024
1 parent 0f3867f commit 4d3cf37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions MdePkg/Library/SmmPciExpressLib/SmmPciExpressLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
PcdLib
DebugLib
IoLib
UefiBootServicesTableLib

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## CONSUMES
Expand Down

0 comments on commit 4d3cf37

Please sign in to comment.