summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2018-06-13 08:39:49 -0700
committerShaohua Li <shli@fb.com>2018-06-18 09:46:13 -0700
commitbfc9dfdcb6e9493de5d4fe0d3ed3ce57672f8d07 (patch)
tree09026d6c62405a6697b4d2dd6198168ca3c972fb /drivers/md/md.c
parent9ffc59d57228d74809700be6f7ecb1db10292f05 (diff)
downloadlinux-bfc9dfdcb6e9493de5d4fe0d3ed3ce57672f8d07.tar.bz2
MD: cleanup resources in failure
We need destroy the memory pool in failure Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 29b0cd9ec951..994aed2f9dff 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -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) {
@@ -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) {
@@ -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;