From: Dan Williams Date: Tue, 4 Aug 2009 17:17:23 +0000 (-0700) Subject: Assemble: fix handling of empty container X-Git-Tag: mdadm-3.0.1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ef383aa9616e183cb1eda38fdbe4d7a2ebdfd4c;p=thirdparty%2Fmdadm.git Assemble: fix handling of empty container # mdadm --create /dev/md/ddf /dev/sd[b-e] -n 4 -e ddf mdadm: container /dev/md/ddf prepared. # mdadm -Ss mdadm: stopped /dev/md126 # mdadm -As mdadm: Container /dev/md/ddf0 has been assembled with 4 drives Segmentation fault Reported-by: Artur Wojcik Reported-by: Jacek Danecki Signed-off-by: Dan Williams --- diff --git a/Assemble.c b/Assemble.c index 3c3a004f..4578906e 100644 --- a/Assemble.c +++ b/Assemble.c @@ -320,6 +320,8 @@ int Assemble(struct supertype *st, char *mddev, content = tmpdev->content; else content = tst->ss->container_content(tst); + if (!content) + goto loop; /* empty container */ tmpdev->content = content->next; if (tmpdev->content == NULL)