Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb2067f7 authored by Dave Jones's avatar Dave Jones Committed by Chris Mason
Browse files

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: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent f5929cd8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}