]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: raid0: fix error return from create_stripe_zones.
authorNeilBrown <neilb@suse.de>
Thu, 21 Feb 2013 04:36:38 +0000 (15:36 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Mar 2013 18:29:49 +0000 (11:29 -0700)
commitfbad8075baa695da5da4952969682172966a4fac
tree4de9c4b8a6363687a93b79d9a3ee342b3d75b831
parentc443082d1998879713ecf9f97ee4ba8c76f8b7f0
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>
drivers/md/raid0.c