aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-06-18 10:47:03 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:35:35 -0400
commit408ef013cc9e2f94a14f7ccbbe52ddfb18437a99 (patch)
tree3168e06e8090210a59af788ca97cd40d87b5282e /fs/namei.c
parentac481d6ca4081bdd348cbd84963d1ece843a3407 (diff)
fs: move path_put on failure out of ->follow_link
Currently the non-nd_set_link based versions of ->follow_link are expected to do a path_put(&nd->path) on failure. This calling convention is unexpected, undocumented and doesn't match what the nd_set_link-based instances do. Move the path_put out of the only non-nd_set_link based ->follow_link instance into the caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 6b29a51bef5d..a9b94c62c303 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -624,7 +624,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
624 *p = dentry->d_inode->i_op->follow_link(dentry, nd); 624 *p = dentry->d_inode->i_op->follow_link(dentry, nd);
625 error = PTR_ERR(*p); 625 error = PTR_ERR(*p);
626 if (IS_ERR(*p)) 626 if (IS_ERR(*p))
627 goto out_put_link; 627 goto out_put_nd_path;
628 628
629 error = 0; 629 error = 0;
630 s = nd_get_link(nd); 630 s = nd_get_link(nd);
@@ -646,7 +646,6 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
646 646
647out_put_nd_path: 647out_put_nd_path:
648 path_put(&nd->path); 648 path_put(&nd->path);
649out_put_link:
650 path_put(link); 649 path_put(link);
651 return error; 650 return error;
652} 651}