]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
policy.c: Fix for compiler error
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Tue, 11 Dec 2018 14:04:07 +0000 (15:04 +0100)
committerJes Sorensen <jsorensen@fb.com>
Tue, 11 Dec 2018 18:59:44 +0000 (13:59 -0500)
After cd72f9d(policy: support devices with multiple paths.) compilation
on old compilers fails because "ā€˜pā€™ may be used uninitialized
in this function".

Initialize it with NULL to prevent this.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
policy.c

index e3a0671f3a3a05501d24162bf743ee714e4f2ac8..3c53bd35e0b19a693ff84b81a927f27c3084048d 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -268,7 +268,7 @@ static int pol_match(struct rule *rule, char **paths, char *type, char **part)
 
        for (; rule; rule = rule->next) {
                if (rule->name == rule_path) {
-                       char *p;
+                       char *p = NULL;
                        int i;
                        if (pathok == 0)
                                pathok = -1;