diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-02-03 17:25:18 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-02-14 05:45:37 +0400 |
commit | e188dc02d3a9c911be56eca5aa114fe7e9822d53 (patch) | |
tree | 8b2ad2bff8dd125b5d809b943620ade2842abb4a /fs/namei.c | |
parent | 3b582f393150c72b18339bc00d7ed4fb22445ed1 (diff) | |
download | linux-e188dc02d3a9c911be56eca5aa114fe7e9822d53.tar.xz |
vfs: fix d_inode_lookup() dentry ref leak
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>
Diffstat (limited to 'fs/namei.c')
-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 208c6aa4a989..a780ea515c47 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -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)) { |