mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-24 15:59:52 -04:00
clean up the failure exits after __do_follow_link() in do_filp_open()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
13
fs/namei.c
13
fs/namei.c
@@ -2426,15 +2426,12 @@ struct file *do_filp_open(int dfd, const char *pathname,
|
||||
nd.flags |= LOOKUP_PARENT;
|
||||
error = __do_follow_link(&link, &nd, &cookie);
|
||||
if (unlikely(error)) {
|
||||
if (!IS_ERR(cookie) && linki->i_op->put_link)
|
||||
linki->i_op->put_link(link.dentry, &nd, cookie);
|
||||
/* nd.path had been dropped */
|
||||
nd.path = link;
|
||||
goto out_path;
|
||||
filp = ERR_PTR(error);
|
||||
} else {
|
||||
nd.flags &= ~LOOKUP_PARENT;
|
||||
filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
|
||||
}
|
||||
nd.flags &= ~LOOKUP_PARENT;
|
||||
filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
|
||||
if (linki->i_op->put_link)
|
||||
if (!IS_ERR(cookie) && linki->i_op->put_link)
|
||||
linki->i_op->put_link(link.dentry, &nd, cookie);
|
||||
path_put(&link);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user