Skip to content

Commit

Permalink
Btrfs: Fix double free and off by one in inode.c
Browse files Browse the repository at this point in the history
The first change removes  potential double free, the second fix a off
by one error.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Yan authored and Chris Mason committed Sep 25, 2008
1 parent bab9fb0 commit 8e1cd76
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ void btrfs_read_locked_inode(struct inode *inode)
memcpy(&location, &BTRFS_I(inode)->location, sizeof(location));
ret = btrfs_lookup_inode(NULL, root, path, &location, 0);
if (ret) {
btrfs_free_path(path);
goto make_bad;
}
inode_item = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]),
Expand Down Expand Up @@ -1536,7 +1535,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
flush_dcache_page(result->b_page);
kunmap(page);
set_extent_uptodate(em_tree, extent_start,
extent_end, GFP_NOFS);
extent_end - 1, GFP_NOFS);
goto insert;
} else {
printk("unkknown found_type %d\n", found_type);
Expand Down

0 comments on commit 8e1cd76

Please sign in to comment.