patch-2.1.54 linux/include/asm-mips/namei.h

Next file: linux/include/asm-ppc/floppy.h
Previous file: linux/include/asm-mips/floppy.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.53/linux/include/asm-mips/namei.h linux/include/asm-mips/namei.h
@@ -25,7 +25,16 @@
 			
 	if (IS_ERR (base)) return base;
 	
-	return lookup_dentry (name, base, follow_link);
+	base = lookup_dentry (name, base, follow_link);
+
+	if (IS_ERR (base)) return base;
+
+	if (!base->d_inode) {
+		dput(base);
+		return ERR_PTR(-ENOENT);
+	}
+        
+        return base;
 }
 
 #ifdef CONFIG_BINFMT_IRIX

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov