mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Btrfs: fix memory leak of chunks' extent map
commit 7d3d1744f8 upstream.
As we're hold a ref on looking up the extent map, we need to drop the ref
before returning to callers.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2845c36289
commit
fb5834ff2b
@@ -4248,6 +4248,7 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len)
|
||||
btrfs_emerg(fs_info, "Invalid mapping for %Lu-%Lu, got "
|
||||
"%Lu-%Lu\n", logical, logical+len, em->start,
|
||||
em->start + em->len);
|
||||
free_extent_map(em);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4429,6 +4430,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
|
||||
btrfs_crit(fs_info, "found a bad mapping, wanted %Lu, "
|
||||
"found %Lu-%Lu\n", logical, em->start,
|
||||
em->start + em->len);
|
||||
free_extent_map(em);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user