From ddd1a492519d61587cdd92660b875b82f4832176 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 15 May 2008 15:50:42 +1000 Subject: [PATCH] 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. --- Assemble.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assemble.c b/Assemble.c index c7cc385d..86212032 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; } -- 2.39.2