Commit 0f585f14 authored by OGAWA Hirofumi's avatar OGAWA Hirofumi Committed by Steven Whitehouse

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: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 066000dd
...@@ -1088,7 +1088,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd) ...@@ -1088,7 +1088,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
error = vfs_follow_link(nd, buf); error = vfs_follow_link(nd, buf);
if (buf != array) if (buf != array)
kfree(buf); kfree(buf);
} } else
path_put(&nd->path);
return ERR_PTR(error); return ERR_PTR(error);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment