Skip to content

Commit

Permalink
[GFS2] Fix uninitialised variable
Browse files Browse the repository at this point in the history
This fixes a bug where, in certain cases an uninitialised variable
could cause a dereference of a NULL pointer in gfs2_commit_write().
Also a typo in a comment is fixed at the same time.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Oct 12, 2006
1 parent 52ae7b7 commit f5c5480
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page,
goto out_unlock;


ip->i_alloc.al_requested = 0;
if (alloc_required) {
al = gfs2_alloc_get(ip);

Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/rgrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void gfs2_rgrp_repolish_clones(struct gfs2_rgrpd *rgd);
struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip);
static inline void gfs2_alloc_put(struct gfs2_inode *ip)
{
return; /* Se we can see where ip->i_alloc is used */
return; /* So we can see where ip->i_alloc is used */
}

int gfs2_inplace_reserve_i(struct gfs2_inode *ip,
Expand Down

0 comments on commit f5c5480

Please sign in to comment.