dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0011-policy.c-Fix-for-compiler-error.patch

c8f3db
From 757e55435997e355ee9b03e5d913b5496a3c39a8 Mon Sep 17 00:00:00 2001
c8f3db
From: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
c8f3db
Date: Tue, 11 Dec 2018 15:04:07 +0100
c8f3db
Subject: [RHEL7.7 PATCH 11/21] policy.c: Fix for compiler error
c8f3db
MIME-Version: 1.0
c8f3db
Content-Type: text/plain; charset=UTF-8
c8f3db
Content-Transfer-Encoding: 8bit
c8f3db
c8f3db
After cd72f9d(policy: support devices with multiple paths.) compilation
c8f3db
on old compilers fails because "ā€˜pā€™ may be used uninitialized
c8f3db
in this function".
c8f3db
c8f3db
Initialize it with NULL to prevent this.
c8f3db
c8f3db
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
c8f3db
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
c8f3db
---
c8f3db
 policy.c | 2 +-
c8f3db
 1 file changed, 1 insertion(+), 1 deletion(-)
c8f3db
c8f3db
diff --git a/policy.c b/policy.c
c8f3db
index e3a0671..3c53bd3 100644
c8f3db
--- a/policy.c
c8f3db
+++ b/policy.c
c8f3db
@@ -268,7 +268,7 @@ static int pol_match(struct rule *rule, char **paths, char *type, char **part)
c8f3db
 
c8f3db
 	for (; rule; rule = rule->next) {
c8f3db
 		if (rule->name == rule_path) {
c8f3db
-			char *p;
c8f3db
+			char *p = NULL;
c8f3db
 			int i;
c8f3db
 			if (pathok == 0)
c8f3db
 				pathok = -1;
c8f3db
-- 
c8f3db
2.7.5
c8f3db