Skip to content

Commit

Permalink
fix leaks in path_lookupat()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 23, 2011
1 parent eddecbb commit bd23a53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit bd23a53

Please sign in to comment.