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.
This commit is contained in:
parent
6ac8aac226
commit
ddd1a49251
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue