From: Al Viro Date: Wed, 23 Mar 2011 13:56:30 +0000 (-0400) Subject: fix leaks in path_lookupat() X-Git-Tag: v2.6.39-rc1~99^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd23a539d0733c9f9ec3f9fc628491fad2658e82;p=profile%2Fivi%2Fkernel-x86-ivi.git fix leaks in path_lookupat() Signed-off-by: Al Viro --- 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 @@ 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; } }