Browse Source

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>
Wang Shilong 12 năm trước cách đây
mục cha
commit
5c2d867fdc
1 tập tin đã thay đổi với 0 bổ sung2 xóa
  1. 0 2
      fs/btrfs/backref.c

+ 0 - 2
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);