[NTOS] Improve MmDeleteProcessAddressSpace

This commit is contained in:
Timo Kreuzer 2022-08-15 15:53:44 +03:00
parent 10fbefdeb0
commit 561b71b644

View file

@ -1379,7 +1379,8 @@ MmDeleteProcessAddressSpace(IN PEPROCESS Process)
/* Remove us from the list */
OldIrql = MiAcquireExpansionLock();
RemoveEntryList(&Process->Vm.WorkingSetExpansionLinks);
if (Process->Vm.WorkingSetExpansionLinks.Flink != NULL)
RemoveEntryList(&Process->Vm.WorkingSetExpansionLinks);
MiReleaseExpansionLock(OldIrql);
/* Acquire the PFN lock */
@ -1421,8 +1422,8 @@ MmDeleteProcessAddressSpace(IN PEPROCESS Process)
}
else
{
/* A partly-initialized process should never exit through here */
ASSERT(FALSE);
DPRINT1("Deleting partially initialized address space of Process %p. Might leak resources.\n",
Process);
}
/* Release the PFN lock */