diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-01-06 11:57:22 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-01-17 20:40:20 -0500 |
commit | 2423fdfb96e3f9ff3baeb6c4c78d74145547891d (patch) | |
tree | a47f7712849dd9ab5c4a1c3371511e072abcdb29 /fs/btrfs/volumes.c | |
parent | a038fab0cb873c75d6675e2bcffce8a3935bdce7 (diff) |
Btrfs, fix memory leaks in error paths
Stanse found 2 memory leaks in relocate_block_group and
__btrfs_map_block. cluster and multi are not freed/assigned on all
paths. Fix that.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 198cff28766d..220dad5db017 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2649,8 +2649,10 @@ again: | |||
2649 | em = lookup_extent_mapping(em_tree, logical, *length); | 2649 | em = lookup_extent_mapping(em_tree, logical, *length); |
2650 | read_unlock(&em_tree->lock); | 2650 | read_unlock(&em_tree->lock); |
2651 | 2651 | ||
2652 | if (!em && unplug_page) | 2652 | if (!em && unplug_page) { |
2653 | kfree(multi); | ||
2653 | return 0; | 2654 | return 0; |
2655 | } | ||
2654 | 2656 | ||
2655 | if (!em) { | 2657 | if (!em) { |
2656 | printk(KERN_CRIT "unable to find logical %llu len %llu\n", | 2658 | printk(KERN_CRIT "unable to find logical %llu len %llu\n", |