From: Dave Jones Date: Tue, 30 Jul 2013 17:42:17 +0000 (-0400) Subject: Fix leak in __btrfs_map_block error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb2067f713ff1c6d867020e85f95fba7d000ed1a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 93f39b1e7173..44abd151132a 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; }