From 3ef383aa9616e183cb1eda38fdbe4d7a2ebdfd4c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 Aug 2009 10:17:23 -0700 Subject: [PATCH] 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 --- Assemble.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.47.2