From c84b5007d07c205ff5e00a68489e312a06ad689b Mon Sep 17 00:00:00 2001 From: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:39:13 +0200 Subject: [PATCH] [NTOS:CM] Simplify CmpDelayAllocBucketLock code a bit (#5729) - Remove duplicate CmpDelayAllocBucketLock definition. - Remove an else. --- ntoskrnl/config/cmalloc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ntoskrnl/config/cmalloc.c b/ntoskrnl/config/cmalloc.c index 7d44ff82135..deabafb82bb 100644 --- a/ntoskrnl/config/cmalloc.c +++ b/ntoskrnl/config/cmalloc.c @@ -15,9 +15,9 @@ /* GLOBALS *******************************************************************/ BOOLEAN CmpAllocInited; -KGUARDED_MUTEX CmpAllocBucketLock, CmpDelayAllocBucketLock; - +KGUARDED_MUTEX CmpAllocBucketLock; LIST_ENTRY CmpFreeKCBListHead; + KGUARDED_MUTEX CmpDelayAllocBucketLock; LIST_ENTRY CmpFreeDelayItemsListHead; @@ -252,16 +252,14 @@ SearchList: /* Clear the KCB pointer */ Entry->Kcb = NULL; } - } - else - { - /* Release the lock */ - KeReleaseGuardedMutex(&CmpDelayAllocBucketLock); - return NULL; + + /* Do the search again */ + goto SearchList; } - /* Do the search again */ - goto SearchList; + /* Release the lock */ + KeReleaseGuardedMutex(&CmpDelayAllocBucketLock); + return NULL; } VOID