diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c index 9cc45bdb3ed..ba87c5e5103 100644 --- a/ntoskrnl/cc/view.c +++ b/ntoskrnl/cc/view.c @@ -831,18 +831,20 @@ CcRosCreateVacb ( } #endif + /* Reference it to allow release */ + CcRosVacbIncRefCount(current); + Status = CcRosMapVacbInKernelSpace(current); if (!NT_SUCCESS(Status)) { RemoveEntryList(¤t->CacheMapVacbListEntry); RemoveEntryList(¤t->VacbLruListEntry); - CcRosReleaseVacbLock(current); + CcRosReleaseVacb(SharedCacheMap, current, FALSE, + FALSE, FALSE); + CcRosVacbDecRefCount(current); ExFreeToNPagedLookasideList(&VacbLookasideList, current); } - /* Reference it to allow release */ - CcRosVacbIncRefCount(current); - return Status; }