Commit 0366ef84 authored by majianpeng's avatar majianpeng Committed by NeilBrown

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

Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 98d5561b
...@@ -407,6 +407,8 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks ...@@ -407,6 +407,8 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks
return array_sectors; return array_sectors;
} }
static int raid0_stop(struct mddev *mddev);
static int raid0_run(struct mddev *mddev) static int raid0_run(struct mddev *mddev)
{ {
struct r0conf *conf; struct r0conf *conf;
...@@ -454,7 +456,12 @@ static int raid0_run(struct mddev *mddev) ...@@ -454,7 +456,12 @@ static int raid0_run(struct mddev *mddev)
blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec); blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
dump_zones(mddev); 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) static int raid0_stop(struct mddev *mddev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment