提交 0366ef84 编写于 作者: M majianpeng 提交者: NeilBrown

md/raid0: If md_integrity_register() fails, raid0_run() must free the mem.

Signed-off-by: Nmajianpeng <majianpeng@gmail.com>
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 98d5561b
......@@ -407,6 +407,8 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks
return array_sectors;
}
static int raid0_stop(struct mddev *mddev);
static int raid0_run(struct mddev *mddev)
{
struct r0conf *conf;
......@@ -454,7 +456,12 @@ static int raid0_run(struct mddev *mddev)
blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
dump_zones(mddev);
return md_integrity_register(mddev);
ret = md_integrity_register(mddev);
if (ret)
raid0_stop(mddev);
return ret;
}
static int raid0_stop(struct mddev *mddev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册