Kernel - Added return value to module cleanup, fixed LVM bugs
[tpg/acess2.git] / KernelLand / Modules / Filesystems / FAT / fat.c
index bb90c3c..d602510 100644 (file)
@@ -105,6 +105,7 @@ tVFS_Node *FAT_InitDevice(const char *Device, const char **Options)
        \r
        if(bs->bps == 0 || bs->spc == 0) {\r
                Log_Notice("FAT", "Error in FAT Boot Sector (zero BPS/SPC)");\r
+               VFS_Close(diskInfo->fileHandle);\r
                return NULL;\r
        }\r
        \r
@@ -185,6 +186,7 @@ tVFS_Node *FAT_InitDevice(const char *Device, const char **Options)
                diskInfo->FATCache = (Uint32*)malloc(sizeof(Uint32)*diskInfo->ClusterCount);\r
                if(diskInfo->FATCache == NULL) {\r
                        Log_Warning("FAT", "Heap Exhausted");\r
+                       VFS_Cose(diskInfo->fileHandle);\r
                        return NULL;\r
                }\r
                Ofs = bs->resvSectCount*512;\r

UCC git Repository :: git.ucc.asn.au