diff options
author | Wang Shilong <wangsl-fnst@cn.fujitsu.com> | 2013-03-31 06:36:37 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-06 15:54:31 -0400 |
commit | 5c2d867fdcbc11a6862379ebd60b2c1a66e13671 (patch) | |
tree | a2bc4d269f91e709fb79d9a7ac30375c0a97e334 | |
parent | f172393952a8771ca8970b8fcdd332a5a6ea0f56 (diff) |
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>
-rw-r--r-- | fs/btrfs/backref.c | 2 |
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, | |||
1510 | iterate, ctx); | 1510 | iterate, ctx); |
1511 | } | 1511 | } |
1512 | ulist_free(roots); | 1512 | ulist_free(roots); |
1513 | roots = NULL; | ||
1514 | } | 1513 | } |
1515 | 1514 | ||
1516 | free_leaf_list(refs); | 1515 | free_leaf_list(refs); |
1517 | ulist_free(roots); | ||
1518 | out: | 1516 | out: |
1519 | if (!search_commit_root) { | 1517 | if (!search_commit_root) { |
1520 | btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem); | 1518 | btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem); |