aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-02-22 22:27:28 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-14 09:15:24 -0400
commitf1afe9efc84476ca42fbb7301a441021063eead7 (patch)
tree5bf606519f5192d97e8da59c989d89c78a62bf27 /fs/namei.c
parent36f3b4f69070fee7c647bab5dc4408990bb3606c (diff)
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:
2426 nd.flags |= LOOKUP_PARENT; 2426 nd.flags |= LOOKUP_PARENT;
2427 error = __do_follow_link(&link, &nd, &cookie); 2427 error = __do_follow_link(&link, &nd, &cookie);
2428 if (unlikely(error)) { 2428 if (unlikely(error)) {
2429 if (!IS_ERR(cookie) && linki->i_op->put_link) 2429 filp = ERR_PTR(error);
2430 linki->i_op->put_link(link.dentry, &nd, cookie); 2430 } else {
2431 /* nd.path had been dropped */ 2431 nd.flags &= ~LOOKUP_PARENT;
2432 nd.path = link; 2432 filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
2433 goto out_path;
2434 } 2433 }
2435 nd.flags &= ~LOOKUP_PARENT; 2434 if (!IS_ERR(cookie) && linki->i_op->put_link)
2436 filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
2437 if (linki->i_op->put_link)
2438 linki->i_op->put_link(link.dentry, &nd, cookie); 2435 linki->i_op->put_link(link.dentry, &nd, cookie);
2439 path_put(&link); 2436 path_put(&link);
2440 } 2437 }