From: Lidong Zhong Date: Sun, 22 Nov 2020 15:12:29 +0000 (+0800) Subject: Detail: fix segfault during IMSM raid creation X-Git-Tag: mdadm-4.2-rc1~36 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=c3129b39a7d467eec063681529f46f84a2a85308 Detail: fix segfault during IMSM raid creation It can be reproduced with non IMSM hardware and IMSM_NO_PLATFORM environmental variable set. The array state is inactive when creating an IMSM container. And the structure info is NULL because load_super() always fails since no intel HBA information could be obtained. Signed-off-by: Lidong Zhong Reported-by: Tkaczyk Mariusz Fixes: 64bf4dff3430 (Detail: show correct raid level when the array is inactive) --- diff --git a/Detail.c b/Detail.c index b6587c8c..ea868847 100644 --- a/Detail.c +++ b/Detail.c @@ -224,7 +224,7 @@ int Detail(char *dev, struct context *c) } /* Ok, we have some info to print... */ - if (inactive) + if (inactive && info) str = map_num(pers, info->array.level); else str = map_num(pers, array.level);