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: 64bf4dff34 (Detail: show correct raid level when the array is inactive)
This commit is contained in:
Lidong Zhong 2020-11-22 23:12:29 +08:00 committed by Jes Sorensen
parent 97b51a2c2d
commit c3129b39a7
1 changed files with 1 additions and 1 deletions

View File

@ -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);