"--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.
This commit is contained in:
Tim Woods 2007-07-23 17:15:52 +10:00 committed by Neil Brown
parent 962a108fb7
commit 9bbcc5f7c4
1 changed files with 2 additions and 1 deletions

View File

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