Skip to content

Commit

Permalink
vfs: fix d_inode_lookup() dentry ref leak
Browse files Browse the repository at this point in the history
d_inode_lookup() leaks a dentry reference on IS_DEADDIR().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Feb 14, 2012
1 parent 3b582f3 commit e188dc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,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)) {
Expand Down

0 comments on commit e188dc0

Please sign in to comment.