dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0097-Detail-fix-segfault-during-IMSM-raid-creation.patch

3c4af5
From c3129b39a7d467eec063681529f46f84a2a85308 Mon Sep 17 00:00:00 2001
3c4af5
From: Lidong Zhong <lidong.zhong@suse.com>
3c4af5
Date: Sun, 22 Nov 2020 23:12:29 +0800
3c4af5
Subject: [PATCH 097/108] Detail: fix segfault during IMSM raid creation
3c4af5
3c4af5
It can be reproduced with non IMSM hardware and IMSM_NO_PLATFORM
3c4af5
environmental variable set. The array state is inactive when creating
3c4af5
an IMSM container. And the structure info is NULL because load_super()
3c4af5
always fails since no intel HBA information could be obtained.
3c4af5
3c4af5
Signed-off-by: Lidong Zhong <lidong.zhong@suse.com>
3c4af5
Reported-by: Tkaczyk Mariusz <mariusz.tkaczyk@intel.com>
3c4af5
Fixes: 64bf4dff3430 (Detail: show correct raid level when the array is inactive)
3c4af5
---
3c4af5
 Detail.c | 2 +-
3c4af5
 1 file changed, 1 insertion(+), 1 deletion(-)
3c4af5
3c4af5
diff --git a/Detail.c b/Detail.c
3c4af5
index b6587c8..ea86884 100644
3c4af5
--- a/Detail.c
3c4af5
+++ b/Detail.c
3c4af5
@@ -224,7 +224,7 @@ int Detail(char *dev, struct context *c)
3c4af5
 	}
3c4af5
 
3c4af5
 	/* Ok, we have some info to print... */
3c4af5
-	if (inactive)
3c4af5
+	if (inactive && info)
3c4af5
 		str = map_num(pers, info->array.level);
3c4af5
 	else
3c4af5
 		str = map_num(pers, array.level);
3c4af5
-- 
3c4af5
2.7.5
3c4af5