[PATCH] Detail: fix segfault during IMSM raid creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
Reported-by: Tkaczyk Mariusz <mariusz.tkaczyk@xxxxxxxxx>
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.26.2





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux