summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLidong Zhong <lidong.zhong@suse.com>2020-11-22 16:12:29 +0100
committerJes Sorensen <jsorensen@fb.com>2020-11-26 00:05:05 +0100
commitc3129b39a7d467eec063681529f46f84a2a85308 (patch)
tree43a5d62023f8a36687041c47f6e7003ff0500418
parentSuper1: allow RAID0 layout setting to be removed. (diff)
downloadmdadm-c3129b39a7d467eec063681529f46f84a2a85308.tar.xz
mdadm-c3129b39a7d467eec063681529f46f84a2a85308.zip
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 <lidong.zhong@suse.com> Reported-by: Tkaczyk Mariusz <mariusz.tkaczyk@intel.com> Fixes: 64bf4dff3430 (Detail: show correct raid level when the array is inactive)
-rw-r--r--Detail.c2
1 files changed, 1 insertions, 1 deletions
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);