Skip to content

Commit

Permalink
GFS2: Fix refcnt leak on gfs2_follow_link() error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
OGAWA Hirofumi authored and Steven Whitehouse committed Jan 12, 2010
1 parent 066000d commit 0f585f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0f585f1

Please sign in to comment.