summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-02-21 15:36:38 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-14 11:26:22 -0700
commit5260b2b544e14287a9d6eab457d89f1658356102 (patch)
treee25455ed6047b454009e38a68c515f2304303734
parentcac9a265334043f9500d385c358e07daa4636d7d (diff)
md: raid0: fix error return from create_stripe_zones.
commit 58ebb34c49fcfcaa029e4b1c1453d92583900f9a upstream. Create_stripe_zones returns an error slightly differently to raid0_run and to raid0_takeover_*. The error returned used by the second was wrong and an error would result in mddev->private being set to NULL and sooner or later a crash. So never return NULL, return ERR_PTR(err), not NULL from create_stripe_zones. This bug has been present since 2.6.35 so the fix is suitable for any kernel since then. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/raid0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 15c8d3505450..d9babda582b9 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -289,7 +289,7 @@ abort:
kfree(conf->strip_zone);
kfree(conf->devlist);
kfree(conf);
- *private_conf = NULL;
+ *private_conf = ERR_PTR(err);
return err;
}