Skip to content

Commit

Permalink
MD: cleanup resources in failure
Browse files Browse the repository at this point in the history
We need destroy the memory pool in failure

Signed-off-by: Shaohua Li <[email protected]>
  • Loading branch information
shligit committed Jun 18, 2018
1 parent 9ffc59d commit bfc9dfd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev)
else
pr_warn("md: personality for level %s is not loaded!\n",
mddev->clevel);
return -EINVAL;
err = -EINVAL;
goto abort;
}
spin_unlock(&pers_lock);
if (mddev->level != pers->level) {
Expand All @@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev)
pers->start_reshape == NULL) {
/* This personality cannot handle reshaping... */
module_put(pers->owner);
return -EINVAL;
err = -EINVAL;
goto abort;
}

if (pers->sync_request) {
Expand Down Expand Up @@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev)
mddev->private = NULL;
module_put(pers->owner);
bitmap_destroy(mddev);
return err;
goto abort;
}
if (mddev->queue) {
bool nonrot = true;
Expand Down

0 comments on commit bfc9dfd

Please sign in to comment.