]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
md/linear: avoid possible oops and array stop
authorNeilBrown <neilb@suse.de>
Mon, 17 May 2010 01:27:00 +0000 (11:27 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:15:49 +0000 (11:15 -0700)
commit ef2f80ff7325b2c1888ff02ead28957b5840bf51 upstream.

Since commit ef286f6fa673cd7fb367e1b145069d8dbfcc6081
it has been important that each personality clears
->private in the ->stop() function, or sets it to a
attribute group to be removed.
linear.c doesn't.  This can sometimes lead to an oops,
though it doesn't always.

Suitable for 2.6.33-stable and 2.6.34.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/linear.c

index 001317b500341b2a9871d66a13c4572a4884abc9..12f4acbabbe37fcbb87cb903f724f17710c5d80f 100644 (file)
@@ -281,6 +281,7 @@ static int linear_stop (mddev_t *mddev)
        rcu_barrier();
        blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
        kfree(conf);
+       mddev->private = NULL;
 
        return 0;
 }