]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
policy: don't try to get policy when path == NULL.
authorNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 08:35:25 +0000 (19:35 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 08:35:25 +0000 (19:35 +1100)
config_rules_has_path, we fail if path==NULL, so we should when
config_rules doesn't has_path too.

Signed-Off-By: NeilBrown <neilb@suse.de>
policy.c

index 5f18034004b59846c9a31ba61ab15b0c4c3730e2..0bc3c4525cd8b98e2292f0ed39893ae70905a63a 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -377,11 +377,10 @@ struct dev_policy *disk_policy(struct mdinfo *disk)
 
        if (!type)
                return NULL;
-       if (config_rules_has_path) {
+       if (config_rules_has_path)
                path = disk_path(disk);
-               if (!path)
-                       return NULL;
-       }
+       if (!path)
+               return NULL;
 
        pol = path_policy(path, type);