X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxe%2FMisc%2FMemoryProtection.c;fp=MdeModulePkg%2FCore%2FDxe%2FMisc%2FMemoryProtection.c;h=47edf86dfbf300e602993fa42fcb0ecf48b7b6e2;hp=7a24bd078157aabdf29ba5aca068e16b6469a127;hb=fb92fe9e1817a53ca0fc985447f3c534201a62fa;hpb=f9d0e5daa058f0cf4caa8edad0dfa2a3a390f1b0 diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c index 7a24bd0781..47edf86dfb 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -1094,6 +1094,11 @@ DisableNullDetectionAtTheEndOfDxe ( ); ASSERT_EFI_ERROR (Status); + // + // Page 0 might have be allocated to avoid misuses. Free it here anyway. + // + CoreFreePages (0, 1); + CoreCloseEvent (Event); DEBUG ((DEBUG_INFO, "DisableNullDetectionAtTheEndOfDxe(): end\r\n"));