]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Detail.c
fix segfaults in Detail()
[thirdparty/mdadm.git] / Detail.c
index 85e2b89d2ff235b9d6b567539109bd2023feb069..67ddc800b262b7312f666cb244ac46d1e71f29c3 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -424,7 +424,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost, char *pre
                }
                free_mdstat(ms);
 
-               if (st->sb && info->reshape_active) {
+               if ((st && st->sb) && (info && info->reshape_active)) {
 #if 0
 This is pretty boring
                        printf("  Reshape pos'n : %llu%s\n", (unsigned long long) info->reshape_progress<<9,
@@ -575,7 +575,8 @@ This is pretty boring
        if (spares && brief && array.raid_disks) printf(" spares=%d", spares);
        if (brief && st && st->sb)
                st->ss->brief_detail_super(st);
-       st->ss->free_super(st);
+       if (st)
+               st->ss->free_super(st);
 
        if (brief > 1 && devices) printf("\n   devices=%s", devices);
        if (brief) printf("\n");