summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-02-24 03:41:31 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-14 16:15:25 +0300
commit7bc055d1d524f209bf49d8b9cb220712dd7df4ed (patch)
tree29971abb7728cb684a29d78b7c9482518d7c46d1 /fs/namei.c
parent13aab428a73d3200b9283b61b7fdf5713181ac66 (diff)
downloadlinux-7bc055d1d524f209bf49d8b9cb220712dd7df4ed.tar.xz
kill out_dput: in link_path_walk()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 01a17dd2f151..fea36369dc87 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1407,22 +1407,19 @@ static int link_path_walk(const char *name, struct nameidata *nd)
err = do_lookup(nd, &this, &next, &inode);
if (err)
break;
- err = -ENOENT;
- if (!inode)
- goto out_dput;
- if (inode->i_op->follow_link) {
+ if (inode && inode->i_op->follow_link) {
err = do_follow_link(inode, &next, nd);
if (err)
goto return_err;
nd->inode = nd->path.dentry->d_inode;
- err = -ENOENT;
- if (!nd->inode)
- break;
} else {
path_to_nameidata(&next, nd);
nd->inode = inode;
}
+ err = -ENOENT;
+ if (!nd->inode)
+ break;
err = -ENOTDIR;
if (!nd->inode->i_op->lookup)
break;
@@ -1472,10 +1469,6 @@ lookup_parent:
nd->last = this;
nd->last_type = type;
return 0;
-out_dput:
- if (!(nd->flags & LOOKUP_RCU))
- path_put_conditional(&next, nd);
- break;
}
if (!(nd->flags & LOOKUP_RCU))
path_put(&nd->path);