summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorTim Woods <timwoods@uklinux.net>2007-07-23 17:15:52 +1000
committerNeil Brown <neilb@suse.de>2007-07-23 17:15:52 +1000
commit9bbcc5f7c4140244abc4d427fe107b9d5c33c257 (patch)
tree23d11f4b85266cfa3cfc38f46765b0d1b0547354 /Detail.c
parent962a108fb7d709c4f056aeecc775d39fa9dcf328 (diff)
downloadmdadm-9bbcc5f7c4140244abc4d427fe107b9d5c33c257.tar.gz
mdadm-9bbcc5f7c4140244abc4d427fe107b9d5c33c257.tar.xz
mdadm-9bbcc5f7c4140244abc4d427fe107b9d5c33c257.zip
"--export" segfaults with non-persistent super blocks
From: Tim Woods <timwoods@uklinux.net> This patch fixes a NULL pointer dereference in Detail.c when running 'mdadm --detail --export' on a device with non-persistent super blocks.
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Detail.c b/Detail.c
index 7e14163..ed100fa 100644
--- a/Detail.c
+++ b/Detail.c
@@ -137,7 +137,8 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
printf("MD_DEVICES=%d\n", array.raid_disks);
printf("MD_METADATA=%d.%d\n", array.major_version,
array.minor_version);
- st->ss->export_super(super);
+ if (super)
+ st->ss->export_super(super);
goto out;
}