summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-05-15 15:50:42 +1000
committerNeil Brown <neilb@suse.de>2008-05-15 15:50:42 +1000
commitddd1a492519d61587cdd92660b875b82f4832176 (patch)
tree748d2fa28e48c13fac898d0b2b00a992c46ea7ac /Assemble.c
parent6ac8aac2267f7949be672510f74655a433b70e41 (diff)
downloadmdadm-ddd1a492519d61587cdd92660b875b82f4832176.tar.gz
mdadm-ddd1a492519d61587cdd92660b875b82f4832176.tar.xz
mdadm-ddd1a492519d61587cdd92660b875b82f4832176.zip
Avoid possible null dereference in Assemble.
If the first device we look at has no superblock, there is no 'st' to free, so don't free it.
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index c7cc385..8621203 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -315,7 +315,8 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
if (!tst || !tst->sb) {
fprintf(stderr, Name ": %s has no superblock - assembly aborted\n",
devname);
- st->ss->free_super(st);
+ if (st)
+ st->ss->free_super(st);
return 1;
}