]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: don't leak extent_map in btrfs_get_io_geometry()
authorJohannes Thumshirn <jthumshirn@suse.de>
Mon, 15 Jul 2019 13:16:12 +0000 (15:16 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 17 Jul 2019 15:03:36 +0000 (17:03 +0200)
commit0697dab66a253b6ae594ccf6af73faf7c0d7695d
treeff4960f4957800454364e1d0c603b911caafb632
parent8439dc0a98ef6e55688ce94c333a9f21148f75ca
btrfs: don't leak extent_map in btrfs_get_io_geometry()

btrfs_get_io_geometry() calls btrfs_get_chunk_map() to acquire a reference
on a extent_map, but on normal operation it does not drop this reference
anymore.

This leads to excessive kmemleak reports.

Always call free_extent_map(), not just in the error case.

Fixes: c7f36c5cf27c ("btrfs: Introduce btrfs_io_geometry infrastructure")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c