summaryrefslogtreecommitdiff
path: root/policy.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-09-07 12:45:24 +1000
committerNeilBrown <neilb@suse.de>2011-09-07 12:45:24 +1000
commit75c2df6509391e28257d696815bddb854a8c4a94 (patch)
tree785b344b3362f782de87c39b19fd25a49e44dc26 /policy.c
parentba714450698a966d184f5337235b100cbfa8685e (diff)
downloadmdadm-75c2df6509391e28257d696815bddb854a8c4a94.tar.gz
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>
Diffstat (limited to 'policy.c')
-rw-r--r--policy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/policy.c b/policy.c
index ebb1481..2bbbac8 100644
--- a/policy.c
+++ b/policy.c
@@ -678,6 +678,8 @@ struct domainlist *domain_from_array(struct mdinfo *mdi, const char *metadata)
{
struct domainlist *domlist = NULL;
+ if (!mdi)
+ return NULL;
for (mdi = mdi->devs ; mdi ; mdi = mdi->next)
domainlist_add_dev(&domlist, makedev(mdi->disk.major,
mdi->disk.minor),