summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>2013-03-31 12:36:37 +0200
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 21:54:31 +0200
commit5c2d867fdcbc11a6862379ebd60b2c1a66e13671 (patch)
treea2bc4d269f91e709fb79d9a7ac30375c0a97e334 /fs
parentBtrfs: kill some BUG_ONs() in the find_parent_nodes() (diff)
downloadlinux-5c2d867fdcbc11a6862379ebd60b2c1a66e13671.tar.xz
linux-5c2d867fdcbc11a6862379ebd60b2c1a66e13671.zip
Btrfs: fix double free in the iterate_extent_inodes()
If btrfs_find_all_roots() fails, 'roots' has been freed or 'roots' fails to allocate. We don't need to free it outside btrfs_find_all_roots() again.Fix it. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/backref.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 3dd0693bad78..ba0fee7c3237 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1510,11 +1510,9 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
iterate, ctx);
}
ulist_free(roots);
- roots = NULL;
}
free_leaf_list(refs);
- ulist_free(roots);
out:
if (!search_commit_root) {
btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem);