From: NeilBrown Date: Tue, 23 Nov 2010 00:11:45 +0000 (+1100) Subject: Monitor: check spare group is non-NULL before adding to domain list X-Git-Tag: mdadm-3.2~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=062dc4817ddb60dcc59d4e98b3dbc784d77426b8;p=thirdparty%2Fmdadm.git Monitor: check spare group is non-NULL before adding to domain list ... otherwise we crash. Reported-by: "Labun, Marcin" Signed-off-by: NeilBrown --- diff --git a/Monitor.c b/Monitor.c index b907cf2d..e0c86917 100644 --- a/Monitor.c +++ b/Monitor.c @@ -732,7 +732,9 @@ static int move_spare(struct state *from, struct state *to, continue; pol = devnum_policy(from->devid[d]); - pol_add(&pol, pol_domain, from->spare_group, NULL); + if (from->spare_group) + pol_add(&pol, pol_domain, + from->spare_group, NULL); if (domain_test(domlist, pol, to->metadata->ss->name)) dev = from->devid[d]; dev_policy_free(pol);