diff --git a/drivers/filesystems/fastfat/cleanup.c b/drivers/filesystems/fastfat/cleanup.c
index 0a12fd7..900f690 100644
--- a/drivers/filesystems/fastfat/cleanup.c
+++ b/drivers/filesystems/fastfat/cleanup.c
@@ -107,6 +107,7 @@ VfatCleanupFile(
                 {
                     pFcb->FileObject = NULL;
                     CcUninitializeCacheMap(tmpFileObject, NULL, NULL);
+                    pFcb->Flags &= ~FCB_CACHE_INITIALIZED;
                     ObDereferenceObject(tmpFileObject);
                 }
 
diff --git a/drivers/filesystems/fastfat/fcb.c b/drivers/filesystems/fastfat/fcb.c
index 4a103b0..1736db2 100644
--- a/drivers/filesystems/fastfat/fcb.c
+++ b/drivers/filesystems/fastfat/fcb.c
@@ -310,10 +310,24 @@ vfatReleaseFCB(
 
     while (pFCB)
     {
+        ULONG RefCount;
+
         ASSERT(pFCB != pVCB->VolumeFcb);
         ASSERT(pFCB->RefCount > 0);
-        pFCB->RefCount--;
-        if (pFCB->RefCount == 0)
+        RefCount = --pFCB->RefCount;
+
+        if (RefCount == 1 && pFCB->Flags & FCB_CACHE_INITIALIZED)
+        {
+            PFILE_OBJECT tmpFileObject;
+            tmpFileObject = pFCB->FileObject;
+
+            pFCB->FileObject = NULL;
+            CcUninitializeCacheMap(tmpFileObject, NULL, NULL);
+            pFCB->Flags &= ~FCB_CACHE_INITIALIZED;
+            ObDereferenceObject(tmpFileObject);
+        }
+
+        if (RefCount == 0)
         {
             ASSERT(pFCB->OpenHandleCount == 0);
             tmpFcb = pFCB->parentFcb;
