aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-23 09:56:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-23 09:56:55 -0400
commitbd23a539d0733c9f9ec3f9fc628491fad2658e82 (patch)
treeb64a04b76be41fe62a734b6e9693890a76b117b3 /fs/namei.c
parenteddecbb601c9ea3fab7e67d7892010fc9426d1e6 (diff)
fix leaks in path_lookupat()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5a9a6c3094da..a4dfac650c3c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1644,13 +1644,16 @@ static int path_lookupat(int dfd, const char *name,
1644 err = -ECHILD; 1644 err = -ECHILD;
1645 } 1645 }
1646 1646
1647 if (!err) 1647 if (!err) {
1648 err = handle_reval_path(nd); 1648 err = handle_reval_path(nd);
1649 if (err)
1650 path_put(&nd->path);
1651 }
1649 1652
1650 if (!err && nd->flags & LOOKUP_DIRECTORY) { 1653 if (!err && nd->flags & LOOKUP_DIRECTORY) {
1651 if (!nd->inode->i_op->lookup) { 1654 if (!nd->inode->i_op->lookup) {
1652 path_put(&nd->path); 1655 path_put(&nd->path);
1653 return -ENOTDIR; 1656 err = -ENOTDIR;
1654 } 1657 }
1655 } 1658 }
1656 1659