mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:MM] Fix PFN lock usage
This commit is contained in:
parent
f4d47faeb7
commit
33949028fb
2 changed files with 7 additions and 4 deletions
|
@ -77,6 +77,8 @@ NTSTATUS
|
|||
NTAPI
|
||||
MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
|
||||
{
|
||||
KIRQL OldIrql;
|
||||
|
||||
if (Page == 0)
|
||||
{
|
||||
DPRINT1("Tried to release page zero.\n");
|
||||
|
@ -85,8 +87,12 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
|
|||
|
||||
(void)InterlockedDecrementUL(&MiMemoryConsumers[Consumer].PagesUsed);
|
||||
|
||||
OldIrql = MiAcquirePfnLock();
|
||||
|
||||
MmDereferencePage(Page);
|
||||
|
||||
MiReleasePfnLock(OldIrql);
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -566,10 +566,9 @@ NTAPI
|
|||
MmDereferencePage(PFN_NUMBER Pfn)
|
||||
{
|
||||
PMMPFN Pfn1;
|
||||
KIRQL OldIrql;
|
||||
DPRINT("MmDereferencePage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
|
||||
|
||||
OldIrql = MiAcquirePfnLock();
|
||||
MI_ASSERT_PFN_LOCK_HELD();
|
||||
|
||||
Pfn1 = MiGetPfnEntry(Pfn);
|
||||
ASSERT(Pfn1);
|
||||
|
@ -596,8 +595,6 @@ MmDereferencePage(PFN_NUMBER Pfn)
|
|||
DPRINT("Legacy free: %lx\n", Pfn);
|
||||
MiInsertPageInFreeList(Pfn);
|
||||
}
|
||||
|
||||
MiReleasePfnLock(OldIrql);
|
||||
}
|
||||
|
||||
PFN_NUMBER
|
||||
|
|
Loading…
Reference in a new issue