]> Pileus Git - ~andy/linux/commitdiff
Btrfs: fix double free in the iterate_extent_inodes()
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>
Sun, 31 Mar 2013 10:36:37 +0000 (10:36 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:31 +0000 (15:54 -0400)
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>
fs/btrfs/backref.c

index 3dd0693bad78e00eef0810e61ef422a86f635591..ba0fee7c3237d17c0e5b82df38bca06f04272445 100644 (file)
@@ -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);