mdadm/SOURCES/0097-Detail-fix-segfault-during-IMSM-raid-creation.patch
2021-09-09 22:05:37 +00:00

34 lines
1.1 KiB
Diff

From c3129b39a7d467eec063681529f46f84a2a85308 Mon Sep 17 00:00:00 2001
From: Lidong Zhong <lidong.zhong@suse.com>
Date: Sun, 22 Nov 2020 23:12:29 +0800
Subject: [PATCH 097/108] 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)
---
Detail.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Detail.c b/Detail.c
index b6587c8..ea86884 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);
--
2.7.5