kill out_dput: in link_path_walk()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2011-02-23 19:41:31 -05:00
parent 13aab428a7
commit 7bc055d1d5

View file

@ -1407,22 +1407,19 @@ static int link_path_walk(const char *name, struct nameidata *nd)
err = do_lookup(nd, &this, &next, &inode); err = do_lookup(nd, &this, &next, &inode);
if (err) if (err)
break; 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); err = do_follow_link(inode, &next, nd);
if (err) if (err)
goto return_err; goto return_err;
nd->inode = nd->path.dentry->d_inode; nd->inode = nd->path.dentry->d_inode;
err = -ENOENT;
if (!nd->inode)
break;
} else { } else {
path_to_nameidata(&next, nd); path_to_nameidata(&next, nd);
nd->inode = inode; nd->inode = inode;
} }
err = -ENOENT;
if (!nd->inode)
break;
err = -ENOTDIR; err = -ENOTDIR;
if (!nd->inode->i_op->lookup) if (!nd->inode->i_op->lookup)
break; break;
@ -1472,10 +1469,6 @@ lookup_parent:
nd->last = this; nd->last = this;
nd->last_type = type; nd->last_type = type;
return 0; return 0;
out_dput:
if (!(nd->flags & LOOKUP_RCU))
path_put_conditional(&next, nd);
break;
} }
if (!(nd->flags & LOOKUP_RCU)) if (!(nd->flags & LOOKUP_RCU))
path_put(&nd->path); path_put(&nd->path);