From 14077e3f4e3e6048484a2e32e7625d869b3458cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Wed, 3 Feb 2021 09:41:04 +0100 Subject: [PATCH] [NTOS:MM] Simplify a check --- ntoskrnl/cache/section/sptab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/cache/section/sptab.c b/ntoskrnl/cache/section/sptab.c index 7d960a1ff08..0877fb085f6 100644 --- a/ntoskrnl/cache/section/sptab.c +++ b/ntoskrnl/cache/section/sptab.c @@ -225,7 +225,7 @@ _MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, MmSetSectionAssociation(PFN_FROM_SSE(Entry), Segment, Offset); InterlockedIncrement64(Segment->ReferenceCount); - if ((Offset->QuadPart > (Segment->LastPage << PAGE_SHIFT)) || !Segment->LastPage) + if (Offset->QuadPart >= (Segment->LastPage << PAGE_SHIFT)) Segment->LastPage = (Offset->QuadPart >> PAGE_SHIFT) + 1; } }