commit | bd23a539d0733c9f9ec3f9fc628491fad2658e82 | [log] [tgz] |
---|---|---|
author | Al Viro <viro@zeniv.linux.org.uk> | Wed Mar 23 09:56:30 2011 -0400 |
committer | Al Viro <viro@zeniv.linux.org.uk> | Wed Mar 23 09:56:55 2011 -0400 |
tree | b64a04b76be41fe62a734b6e9693890a76b117b3 | |
parent | eddecbb601c9ea3fab7e67d7892010fc9426d1e6 [diff] [blame] |
fix leaks in path_lookupat() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/namei.c b/fs/namei.c index 5a9a6c3..a4dfac6 100644 --- a/fs/namei.c +++ b/fs/namei.c
@@ -1644,13 +1644,16 @@ err = -ECHILD; } - if (!err) + if (!err) { err = handle_reval_path(nd); + if (err) + path_put(&nd->path); + } if (!err && nd->flags & LOOKUP_DIRECTORY) { if (!nd->inode->i_op->lookup) { path_put(&nd->path); - return -ENOTDIR; + err = -ENOTDIR; } }