提交 258fa999 编写于 作者: A Al Viro

lift path_put(path) to callers of __do_follow_link()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 d231412d
......@@ -644,8 +644,6 @@ static __always_inline int __do_follow_link(struct path *path, struct nameidata
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, nd, cookie);
}
path_put(path);
return error;
}
......@@ -672,6 +670,7 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd)
current->total_link_count++;
nd->depth++;
err = __do_follow_link(path, nd);
path_put(path);
current->link_count--;
nd->depth--;
return err;
......@@ -1864,6 +1863,7 @@ struct file *do_filp_open(int dfd, const char *pathname,
if (error)
goto exit_dput;
error = __do_follow_link(&path, &nd);
path_put(&path);
if (error) {
/* Does someone understand code flow here? Or it is only
* me so stupid? Anathema to whoever designed this non-sense
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册