
From: Miklos Szeredi <miklos@szeredi.hu>

This patch fixes an inode leak in fuse_get_dentry().  With libfuse this
practically never triggers, but a DoS exploit could be written.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/fuse/inode.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN fs/fuse/inode.c~fuse-nfs-export-inode-leak-fix fs/fuse/inode.c
--- 25/fs/fuse/inode.c~fuse-nfs-export-inode-leak-fix	Fri Mar  4 15:35:53 2005
+++ 25-akpm/fs/fuse/inode.c	Fri Mar  4 15:35:53 2005
@@ -438,8 +438,12 @@ static struct dentry *fuse_get_dentry(st
 		return ERR_PTR(-ESTALE);
 
 	inode = ilookup5(sb, nodeid, fuse_inode_eq, &nodeid);
-	if (!inode || inode->i_generation != generation)
+	if (!inode)
 		return ERR_PTR(-ESTALE);
+	if (inode->i_generation != generation) {
+		iput(inode);
+		return ERR_PTR(-ESTALE);
+	}
 
 	entry = d_alloc_anon(inode);
 	if (!entry) {
_
