Skip to content

Commit

Permalink
[GFS2] Fix use after free bug in dir.c
Browse files Browse the repository at this point in the history
Fix a use after free bug in dir.c spotted by Kevin Anderson.

Cc: Kevin Anderson <kanderso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Jul 17, 2006
1 parent 4bf311d commit 634ee0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/gfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,9 +1763,8 @@ static int foreach_leaf(struct gfs2_inode *dip, leaf_call_t lc, void *data)
if (error)
goto out;
leaf = (struct gfs2_leaf *)bh->b_data;
brelse(bh);

len = 1 << (dip->i_di.di_depth - be16_to_cpu(leaf->lf_depth));
brelse(bh);

error = lc(dip, index, len, leaf_no, data);
if (error)
Expand All @@ -1781,7 +1780,7 @@ static int foreach_leaf(struct gfs2_inode *dip, leaf_call_t lc, void *data)
error = -EIO;
}

out:
out:
kfree(lp);

return error;
Expand Down

0 comments on commit 634ee0b

Please sign in to comment.