From: NeilBrown Date: Mon, 22 Nov 2010 08:35:25 +0000 (+1100) Subject: policy: don't try to get policy when path == NULL. X-Git-Tag: mdadm-3.2~317 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9b004ebc7abd5a4d8ddafef1fbf08409f24b330;p=thirdparty%2Fmdadm.git 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 --- 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);