From: OGAWA Hirofumi Date: Mon, 11 Jan 2010 18:36:57 +0000 (+0900) Subject: GFS2: Fix refcnt leak on gfs2_follow_link() error path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0f585f14d4e34ab701283e9237ac7695cd7c9e31;p=mv-sheeva.git GFS2: Fix refcnt leak on gfs2_follow_link() error path If ->follow_link handler return the error, it should decrement nd->path refcnt. This patch fix it. Signed-off-by: OGAWA Hirofumi Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 78f73ca1ef3..84350e1be66 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c @@ -1088,7 +1088,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd) error = vfs_follow_link(nd, buf); if (buf != array) kfree(buf); - } + } else + path_put(&nd->path); return ERR_PTR(error); }