diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-23 13:56:30 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-23 13:56:55 (GMT) |
commit | bd23a539d0733c9f9ec3f9fc628491fad2658e82 (patch) | |
tree | b64a04b76be41fe62a734b6e9693890a76b117b3 | |
parent | eddecbb601c9ea3fab7e67d7892010fc9426d1e6 (diff) | |
download | linux-fsl-qoriq-bd23a539d0733c9f9ec3f9fc628491fad2658e82.tar.xz |
fix leaks in path_lookupat()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1644,13 +1644,16 @@ static int path_lookupat(int dfd, const char *name, 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; } } |