mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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>
This commit is contained in:
parent
3b582f3931
commit
e188dc02d3
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user