summaryrefslogtreecommitdiffstats
path: root/policy.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 09:35:25 +0100
committerNeilBrown <neilb@suse.de>2010-11-22 09:35:25 +0100
commitb9b004ebc7abd5a4d8ddafef1fbf08409f24b330 (patch)
tree50314f3e1935caf9501ef0c3be71011c8f2f6d96 /policy.c
parentFix error in pol_sort. (diff)
downloadmdadm-b9b004ebc7abd5a4d8ddafef1fbf08409f24b330.tar.xz
mdadm-b9b004ebc7abd5a4d8ddafef1fbf08409f24b330.zip
policy: don't try to get policy when path == NULL.
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>
Diffstat (limited to 'policy.c')
-rw-r--r--policy.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/policy.c b/policy.c
index 5f180340..0bc3c452 100644
--- 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);