summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorKen Lautner <kenlautner3@gmail.com>2024-08-23 15:39:53 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-04 00:53:54 +0000
commit559affab2e82aba4e0819d299d5a8de03e276af6 (patch)
treef3d5eb4e250a785b606ca0fe7c4d9b9040346b14 /MdeModulePkg/Core
parentb17ac09cc4bb48692ec20ca583a8f70dc7d25d95 (diff)
downloadedk2-559affab2e82aba4e0819d299d5a8de03e276af6.tar.gz
MdeModulePkg: Fix redundant call to RestoreTpl()
Comments out a redundant call to RestoreTpl(). While this does not technically violate spec on raise/restore TPL, TPL should already be at the specified level. This extra call introduces an asymmetry between RaiseTpl and RestoreTpl calls, which makes analysis of TPL correctness more difficult and hampers certain non-standard TPL usages that some platforms require. Additionally, the two TPL variables were renamed to provide context for each of them. Signed-off-by: Kenneth Lautner <kenlautner3@gmail.com>
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/Dxe/Image/Image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c
index 37fc74d5d1..8d12f93d7f 100644
--- a/MdeModulePkg/Core/Dxe/Image/Image.c
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c
@@ -1725,7 +1725,9 @@ CoreStartImage (
// Image has completed. Verify the tpl is the same
//
ASSERT (Image->Tpl == gEfiCurrentTpl);
- CoreRestoreTpl (Image->Tpl);
+ if (Image->Tpl != gEfiCurrentTpl) {
+ CoreRestoreTpl (Image->Tpl);
+ }
CoreFreePool (Image->JumpBuffer);