From 065fa46f5de017d6a01263623442b31f44e41cd2 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 24 Jan 2013 10:38:28 -0800 Subject: btrfs-progs: don't leak multi-bio in find_root() It wasn't freed if it didn't find metadata. Signed-off-by: Zach Brown --- find-root.c | 1 + 1 file changed, 1 insertion(+) (limited to 'find-root.c') diff --git a/find-root.c b/find-root.c index 51e9a233..f5ca0956 100644 --- a/find-root.c +++ b/find-root.c @@ -385,6 +385,7 @@ static int find_root(struct btrfs_root *root) if (!(type & BTRFS_BLOCK_GROUP_METADATA)) { offset += map_length; + kfree(multi); continue; } -- cgit v1.2.3 From dbeedbed2aeb87c9add3c147c46a574b0e34be61 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 24 Jan 2013 18:18:57 -0600 Subject: btrfs-progs: remove duplicate __setup_root __setup_root() was present in find-root.c as well as disk-io.c. No need for the cut and paste, just use the one in disk-io.c Signed-off-by: Eric Sandeen Signed-off-by: Zach Brown --- find-root.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'find-root.c') diff --git a/find-root.c b/find-root.c index f5ca0956..9ff342fc 100644 --- a/find-root.c +++ b/find-root.c @@ -65,32 +65,6 @@ int csum_block(void *buf, u32 len) return ret; } -static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, - u32 stripesize, struct btrfs_root *root, - struct btrfs_fs_info *fs_info, u64 objectid) -{ - root->node = NULL; - root->commit_root = NULL; - root->sectorsize = sectorsize; - root->nodesize = nodesize; - root->leafsize = leafsize; - root->stripesize = stripesize; - root->ref_cows = 0; - root->track_dirty = 0; - - root->fs_info = fs_info; - root->objectid = objectid; - root->last_trans = 0; - root->highest_inode = 0; - root->last_inode_alloc = 0; - - INIT_LIST_HEAD(&root->dirty_list); - memset(&root->root_key, 0, sizeof(root->root_key)); - memset(&root->root_item, 0, sizeof(root->root_item)); - root->root_key.objectid = objectid; - return 0; -} - static int close_all_devices(struct btrfs_fs_info *fs_info) { struct list_head *list; -- cgit v1.2.3