diff options
author | NeilBrown <neilb@suse.de> | 2013-02-20 23:36:38 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-02-25 19:57:04 -0500 |
commit | 58ebb34c49fcfcaa029e4b1c1453d92583900f9a (patch) | |
tree | 797af00762847745eb34f1fa6241f5d157fd5f04 /drivers/md | |
parent | a64685399181780998281fe07309a94b25dd24c3 (diff) |
md: raid0: fix error return from create_stripe_zones.
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.
Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid0.c | 2 |
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: | |||
289 | kfree(conf->strip_zone); | 289 | kfree(conf->strip_zone); |
290 | kfree(conf->devlist); | 290 | kfree(conf->devlist); |
291 | kfree(conf); | 291 | kfree(conf); |
292 | *private_conf = NULL; | 292 | *private_conf = ERR_PTR(err); |
293 | return err; | 293 | return err; |
294 | } | 294 | } |
295 | 295 | ||