FIX: Prevent using null list pointer
When not all attributes are supported (attributes incompatibility) function container_content_imsm returns NULL pointer. We need to cope with a NULL list better. Reported-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
ba71445069
commit
75c2df6509
|
@ -1464,7 +1464,7 @@ static int Incremental_container(struct supertype *st, char *devname,
|
||||||
fprintf(stderr, Name ": failed to get exclusive lock on "
|
fprintf(stderr, Name ": failed to get exclusive lock on "
|
||||||
"mapfile\n");
|
"mapfile\n");
|
||||||
/* do not assemble arrays that might have bad blocks */
|
/* do not assemble arrays that might have bad blocks */
|
||||||
if (list->array.state & (1<<MD_SB_BBM_ERRORS)) {
|
if (list && list->array.state & (1<<MD_SB_BBM_ERRORS)) {
|
||||||
fprintf(stderr, Name ": BBM log found in metadata. "
|
fprintf(stderr, Name ": BBM log found in metadata. "
|
||||||
"Cannot activate array(s).\n");
|
"Cannot activate array(s).\n");
|
||||||
/* free container data and exit */
|
/* free container data and exit */
|
||||||
|
|
2
policy.c
2
policy.c
|
@ -678,6 +678,8 @@ struct domainlist *domain_from_array(struct mdinfo *mdi, const char *metadata)
|
||||||
{
|
{
|
||||||
struct domainlist *domlist = NULL;
|
struct domainlist *domlist = NULL;
|
||||||
|
|
||||||
|
if (!mdi)
|
||||||
|
return NULL;
|
||||||
for (mdi = mdi->devs ; mdi ; mdi = mdi->next)
|
for (mdi = mdi->devs ; mdi ; mdi = mdi->next)
|
||||||
domainlist_add_dev(&domlist, makedev(mdi->disk.major,
|
domainlist_add_dev(&domlist, makedev(mdi->disk.major,
|
||||||
mdi->disk.minor),
|
mdi->disk.minor),
|
||||||
|
|
Loading…
Reference in New Issue