dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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