summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2013-07-30 13:42:17 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 08:04:45 -0400
commiteb2067f713ff1c6d867020e85f95fba7d000ed1a (patch)
tree4875085b04ddcd397cfd319c7ca2ff0808b3f43e /fs/btrfs/volumes.c
parentf5929cd814ca0a7012bf31d566c8bbd0cd469322 (diff)
downloadop-kernel-dev-eb2067f713ff1c6d867020e85f95fba7d000ed1a.zip
op-kernel-dev-eb2067f713ff1c6d867020e85f95fba7d000ed1a.tar.gz
Fix leak in __btrfs_map_block error path
If we bail out when the stripe alloc fails, we need to undo the earlier allocation of raid_map. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 93f39b1..44abd15 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4673,6 +4673,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
}
bbio = kzalloc(btrfs_bio_size(num_alloc_stripes), GFP_NOFS);
if (!bbio) {
+ kfree(raid_map);
ret = -ENOMEM;
goto out;
}
OpenPOWER on IntegriCloud