Kernel: Bug fix: _mknod() always failed
authorWill Sowerbutts <will@sowerbutts.com>
Fri, 23 Jan 2015 23:26:41 +0000 (23:26 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Fri, 23 Jan 2015 23:27:06 +0000 (23:27 +0000)
Kernel/syscall_fs2.c

index 872b608..379dd72 100644 (file)
@@ -108,7 +108,8 @@ int16_t _mknod(void)
        }
 
        filename(name, fname);
-       if ((ino = newfile(parent, fname)) != NULL)
+       ino = newfile(parent, fname);
+       if(!ino)
                goto nogood3;   /* parent inode is derefed in newfile. SN */
 
        /* Initialize mode and dev */
@@ -762,4 +763,4 @@ done:
 
 
 #undef file
-#undef lockop
\ No newline at end of file
+#undef lockop