提交 eb2067f7 编写于 作者: D Dave Jones 提交者: Chris Mason

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: NDave Jones <davej@redhat.com>
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
Signed-off-by: NChris Mason <chris.mason@fusionio.com>
上级 f5929cd8
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册