]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Detail: fix segfault during IMSM raid creation
authorLidong Zhong <lidong.zhong@suse.com>
Sun, 22 Nov 2020 15:12:29 +0000 (23:12 +0800)
committerJes Sorensen <jsorensen@fb.com>
Wed, 25 Nov 2020 23:05:05 +0000 (18:05 -0500)
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

index b6587c8c8db356b04ea3613f2e02d902a64d2943..ea86884792cd9ebcf034d3a71387a315ded3f1fa 100644 (file)
--- 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);