patch-2.4.22 linux-2.4.22/fs/coda/file.c

Next file: linux-2.4.22/fs/dquot.c
Previous file: linux-2.4.22/fs/coda/dir.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/fs/coda/file.c linux-2.4.22/fs/coda/file.c
@@ -117,16 +117,18 @@
 	coda_vfs_stat.open++;
 
 	cfi = kmalloc(sizeof(struct coda_file_info), GFP_KERNEL);
-	if (!cfi) {
-		unlock_kernel();
+	if (!cfi)
 		return -ENOMEM;
-	}
 
 	lock_kernel();
 
 	error = venus_open(coda_inode->i_sb, coda_i2f(coda_inode), coda_flags,
 			   &host_file); 
-	if (error || !host_file) {
+
+	if (!error && !host_file)
+		error = EBADF;
+
+	if (error) {
 		kfree(cfi);
 		unlock_kernel();
 		return error;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)