From 8494688eebecb287973569dc1261fd0741706324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Thu, 18 Mar 2021 09:05:00 +0100 Subject: [PATCH] [NTOS:MM] Do not use atomic operations to set a bit while holding a lock. Saving your fingers from typing it doesn't make it better code. --- ntoskrnl/mm/ARM3/expool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/mm/ARM3/expool.c b/ntoskrnl/mm/ARM3/expool.c index fb55f9159ba..95bc21ad822 100644 --- a/ntoskrnl/mm/ARM3/expool.c +++ b/ntoskrnl/mm/ARM3/expool.c @@ -1734,7 +1734,7 @@ ExpFindAndRemoveTagBigPages(IN PVOID Va, // Set the free bit, and decrement the number of allocations. Finally, release // the lock and return the tag that was located // - InterlockedIncrement((PLONG)&Entry->Va); + Entry->Va = (PVOID)((ULONG_PTR)Entry->Va | POOL_BIG_TABLE_ENTRY_FREE); ExpPoolBigEntriesInUse--;