branch update for HEAD-2003021201
[reactos.git] / drivers / fs / cdfs / cleanup.c
index d989897..4f0a71a 100644 (file)
@@ -58,8 +58,11 @@ CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt,
       return  STATUS_SUCCESS;
     }
 
-  /* Uninitialize the file cache. */
-  CcRosReleaseFileCache (FileObject, Ccb->Fcb->RFCB.Bcb);
+  /* Uninitialize file cache if initialized for this file object. */
+  if (Ccb->Fcb->RFCB.Bcb != NULL)
+    {
+      CcRosReleaseFileCache (FileObject, Ccb->Fcb->RFCB.Bcb);
+    }
  
   return STATUS_SUCCESS;
 }