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>
This commit is contained in:
NeilBrown 2010-11-22 19:35:25 +11:00
parent 37194990aa
commit b9b004ebc7
1 changed files with 3 additions and 4 deletions

View File

@ -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);