Monitor: avoid NULL dereference with 0.90 metadata
0.90 array do not report the metadata type in /proc/mdstat, so
we cannot assume that mse->metadata_version is non-NULL.
So add an appropriate check.
This adds an additional check missed by commit
eb28e119b0
.
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
b357ef43f9
commit
4019ad0701
|
@ -577,7 +577,8 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
|
|||
info[i].major = info[i].minor = 0;
|
||||
}
|
||||
|
||||
if (strncmp(mse->metadata_version, "external:", 9) == 0 &&
|
||||
if (mse->metadata_version &&
|
||||
strncmp(mse->metadata_version, "external:", 9) == 0 &&
|
||||
is_subarray(mse->metadata_version+9))
|
||||
st->parent_dev =
|
||||
devname2devnum(mse->metadata_version+10);
|
||||
|
|
Loading…
Reference in New Issue