kill out_dput: in link_path_walk()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Feb 2011 00:41:31 +0000 (19:41 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 14 Mar 2011 13:15:25 +0000 (09:15 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 01a17dd2f1511e935dedd7f13c18c9db1462b62a..fea36369dc87ce1b7b49fb32ee50211a08b94ec1 100644 (file)
@@ -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);