summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-02-23 04:27:28 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-14 14:15:24 +0100
commitf1afe9efc84476ca42fbb7301a441021063eead7 (patch)
tree5bf606519f5192d97e8da59c989d89c78a62bf27 /fs/namei.c
parentpull security_inode_follow_link() into __do_follow_link() (diff)
downloadlinux-f1afe9efc84476ca42fbb7301a441021063eead7.tar.xz
linux-f1afe9efc84476ca42fbb7301a441021063eead7.zip
clean up the failure exits after __do_follow_link() in do_filp_open()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/namei.c b/fs/namei.c
index f956567270bb..e0f59031be87 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2426,15 +2426,12 @@ reval:
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);
}