mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
md: raid0: fix error return from create_stripe_zones.
commit 58ebb34c49 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>
This commit is contained in:
parent
c443082d19
commit
fbad8075ba
|
|
@ -280,7 +280,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
|
|||
kfree(conf->strip_zone);
|
||||
kfree(conf->devlist);
|
||||
kfree(conf);
|
||||
*private_conf = NULL;
|
||||
*private_conf = ERR_PTR(err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user