Btrfs: fix em leak in find_first_block_group
authorJosef Bacik <jbacik@fb.com>
Thu, 18 Aug 2016 19:30:06 +0000 (15:30 -0400)
committerChris Mason <clm@fb.com>
Thu, 25 Aug 2016 10:58:29 +0000 (03:58 -0700)
We need to call free_extent_map() on the em we look up.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent-tree.c

index d5d3cfb1f66fdaca1ca981fe2453e20b434c4636..60d4ae7ce97464b8312b344ab35a41bef61d2439 100644 (file)
@@ -9887,6 +9887,7 @@ static int find_first_block_group(struct btrfs_root *root,
                        } else {
                                ret = 0;
                        }
+                       free_extent_map(em);
                        goto out;
                }
                path->slots[0]++;