mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
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>
This commit is contained in:
parent
f5929cd814
commit
eb2067f713
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue