Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89312214 authored by Ian Kent's avatar Ian Kent Committed by Al Viro
Browse files

vfs - fix dentry ref count in do_lookup()



There is a ref count problem in fs/namei.c:do_lookup().

When walking in ref-walk mode, if follow_managed() returns a fail we
need to drop dentry and possibly vfsmount.  Clean up properly,
as we do in the other caller of follow_managed().

Signed-off-by: default avatarIan Kent <raven@themaw.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c14cc63a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1272,8 +1272,10 @@ done:
	path->mnt = mnt;
	path->dentry = dentry;
	err = follow_managed(path, nd->flags);
	if (unlikely(err < 0))
	if (unlikely(err < 0)) {
		path_put_conditional(path, nd);
		return err;
	}
	*inode = path->dentry->d_inode;
	return 0;