[NTOSKRNL] Properly delete VACB in CcRosCreateVacb() when mapping fails.

Spotted by Thomas.

CORE-14478
CORE-14502
This commit is contained in:
Pierre Schweitzer 2018-03-25 18:26:32 +02:00
parent c9cda4cb37
commit ffd524275e
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -831,18 +831,20 @@ CcRosCreateVacb (
} }
#endif #endif
/* Reference it to allow release */
CcRosVacbIncRefCount(current);
Status = CcRosMapVacbInKernelSpace(current); Status = CcRosMapVacbInKernelSpace(current);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
RemoveEntryList(&current->CacheMapVacbListEntry); RemoveEntryList(&current->CacheMapVacbListEntry);
RemoveEntryList(&current->VacbLruListEntry); RemoveEntryList(&current->VacbLruListEntry);
CcRosReleaseVacbLock(current); CcRosReleaseVacb(SharedCacheMap, current, FALSE,
FALSE, FALSE);
CcRosVacbDecRefCount(current);
ExFreeToNPagedLookasideList(&VacbLookasideList, current); ExFreeToNPagedLookasideList(&VacbLookasideList, current);
} }
/* Reference it to allow release */
CcRosVacbIncRefCount(current);
return Status; return Status;
} }