https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c84b5007d07c205ff5e00a...
commit c84b5007d07c205ff5e00a68489e312a06ad689b Author: Serge Gautherie 32623169+SergeGautherie@users.noreply.github.com AuthorDate: Thu Sep 28 11:39:13 2023 +0200 Commit: GitHub noreply@github.com CommitDate: Thu Sep 28 11:39:13 2023 +0200
[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