Commit bfc9dfdc authored by Shaohua Li's avatar Shaohua Li

MD: cleanup resources in failure

We need destroy the memory pool in failure
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent 9ffc59d5
...@@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev) ...@@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev)
else else
pr_warn("md: personality for level %s is not loaded!\n", pr_warn("md: personality for level %s is not loaded!\n",
mddev->clevel); mddev->clevel);
return -EINVAL; err = -EINVAL;
goto abort;
} }
spin_unlock(&pers_lock); spin_unlock(&pers_lock);
if (mddev->level != pers->level) { if (mddev->level != pers->level) {
...@@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev) ...@@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev)
pers->start_reshape == NULL) { pers->start_reshape == NULL) {
/* This personality cannot handle reshaping... */ /* This personality cannot handle reshaping... */
module_put(pers->owner); module_put(pers->owner);
return -EINVAL; err = -EINVAL;
goto abort;
} }
if (pers->sync_request) { if (pers->sync_request) {
...@@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev) ...@@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev)
mddev->private = NULL; mddev->private = NULL;
module_put(pers->owner); module_put(pers->owner);
bitmap_destroy(mddev); bitmap_destroy(mddev);
return err; goto abort;
} }
if (mddev->queue) { if (mddev->queue) {
bool nonrot = true; bool nonrot = true;
......
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