mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 03:23:34 +08:00
[NTOS:MM] MmPurgeSegment: Fix missing MmDereferenceSegment cleanup (#7509)
MiGrabDataSection adds a refcount. There is a missing MmDereferenceSegment cleanup in case of range check error. Fix that by moving MiGrabDataSection calling code to after range check.
This commit is contained in:
parent
2e3a080e10
commit
d52031a4f1
@ -4838,13 +4838,6 @@ MmPurgeSegment(
|
||||
LARGE_INTEGER PurgeStart, PurgeEnd;
|
||||
PMM_SECTION_SEGMENT Segment;
|
||||
|
||||
Segment = MiGrabDataSection(SectionObjectPointer);
|
||||
if (!Segment)
|
||||
{
|
||||
/* Nothing to purge */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PurgeStart.QuadPart = Offset ? Offset->QuadPart : 0LL;
|
||||
if (Length && Offset)
|
||||
{
|
||||
@ -4852,6 +4845,13 @@ MmPurgeSegment(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Segment = MiGrabDataSection(SectionObjectPointer);
|
||||
if (!Segment)
|
||||
{
|
||||
/* Nothing to purge */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
MmLockSectionSegment(Segment);
|
||||
|
||||
if (!Length || !Offset)
|
||||
|
Loading…
Reference in New Issue
Block a user