aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2010-01-11 13:36:57 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2010-01-12 04:30:15 -0500
commit0f585f14d4e34ab701283e9237ac7695cd7c9e31 (patch)
tree7ded56c8f9ddc84d4930a5a9f0f52c9b1464f6e1 /fs/gfs2
parent066000dd856709b6980123eb39b957fe26993f7b (diff)
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 <hirofumi@mail.parknet.co.jp> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/ops_inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 78f73ca1ef3e..84350e1be66d 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)
1088 error = vfs_follow_link(nd, buf); 1088 error = vfs_follow_link(nd, buf);
1089 if (buf != array) 1089 if (buf != array)
1090 kfree(buf); 1090 kfree(buf);
1091 } 1091 } else
1092 path_put(&nd->path);
1092 1093
1093 return ERR_PTR(error); 1094 return ERR_PTR(error);
1094} 1095}