validate_geometry_imsm_volume(): Avoid NULL pointer dereference

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Jes Sorensen 2011-11-01 16:09:34 +01:00 committed by NeilBrown
parent 39c74d5e25
commit b2916f2514
1 changed files with 3 additions and 1 deletions

View File

@ -5139,7 +5139,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
{
struct stat stb;
struct intel_super *super = st->sb;
struct imsm_super *mpb = super->anchor;
struct imsm_super *mpb;
struct dl *dl;
unsigned long long pos = 0;
unsigned long long maxsize;
@ -5150,6 +5150,8 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
if (!super)
return 0;
mpb = super->anchor;
if (mpb->num_raid_devs > 0 && mpb->num_disks != raiddisks) {
fprintf(stderr, Name ": the option-rom requires all "
"member disks to be a member of all volumes.\n");