diff options
author | Neil Brown <neilb@suse.de> | 2008-05-15 15:50:42 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-05-15 15:50:42 +1000 |
commit | ddd1a492519d61587cdd92660b875b82f4832176 (patch) | |
tree | 748d2fa28e48c13fac898d0b2b00a992c46ea7ac /Assemble.c | |
parent | 6ac8aac2267f7949be672510f74655a433b70e41 (diff) | |
download | mdadm-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |