Modules/Tegra2Vid - Misc
[tpg/acess2.git] / KernelLand / Kernel / vfs / dir.c
index 2417539..911eff6 100644 (file)
@@ -74,7 +74,7 @@ int VFS_MkNod(const char *Path, Uint Flags)
        }
 
        // Permissions Check
-       if( !VFS_CheckACL(parent, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) {
+       if( !VFS_CheckACL(parent, VFS_PERM_EXEC|VFS_PERM_WRITE) ) {
                errno = EACCES;
                goto _error;
        }
@@ -104,9 +104,11 @@ int VFS_MkNod(const char *Path, Uint Flags)
        return ret==NULL;
 
 _error:
-       _CloseNode(parent);
-       ASSERT(mountpt->OpenHandleCount>0);
-       mountpt->OpenHandleCount --;
+       if( parent ) {
+               _CloseNode(parent);
+               ASSERT(mountpt->OpenHandleCount>0);
+               mountpt->OpenHandleCount --;
+       }
        free(absPath);
        LEAVE('i', -1);
        return -1;

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