diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-02-03 14:25:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-29 16:30:53 -0800 |
commit | 3c40e5e0828215d90ab4374405019cd5d170615b (patch) | |
tree | eb483cbce1b037c1dee7045b4c02f30ff3c67234 | |
parent | cadd96ffcc3e4c6db78a08d0ea95fec1ddaecf18 (diff) |
vfs: fix d_inode_lookup() dentry ref leak
commit e188dc02d3a9c911be56eca5aa114fe7e9822d53 upstream.
d_inode_lookup() leaks a dentry reference on IS_DEADDIR().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/namei.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index 5008f01787f5..744e942fbf45 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1094,8 +1094,10 @@ static struct dentry *d_inode_lookup(struct dentry *parent, struct dentry *dentr struct dentry *old; /* Don't create child dentry for a dead directory. */ - if (unlikely(IS_DEADDIR(inode))) + if (unlikely(IS_DEADDIR(inode))) { + dput(dentry); return ERR_PTR(-ENOENT); + } old = inode->i_op->lookup(inode, dentry, nd); if (unlikely(old)) { |