diff --git a/bugfix-fix-where-local-variables-are-not-initialized.patch b/bugfix-fix-where-local-variables-are-not-initialized.patch new file mode 100644 index 0000000000000000000000000000000000000000..43afc9e6fcb65dde99866d630bb33bbea9a9fb97 --- /dev/null +++ b/bugfix-fix-where-local-variables-are-not-initialized.patch @@ -0,0 +1,34 @@ +From fd8c8d1f66a9058a27c2d1fbfb11225499abebb1 Mon Sep 17 00:00:00 2001 +From: Lostwayzxc +Date: Wed, 15 Dec 2021 12:54:41 +0800 +Subject: [PATCH] fix where local variables are not initialized + +--- + ras-cpu-isolation.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ras-cpu-isolation.c b/ras-cpu-isolation.c +index bca7e0b..acef1ad 100644 +--- a/ras-cpu-isolation.c ++++ b/ras-cpu-isolation.c +@@ -112,6 +112,8 @@ static int init_cpu_info(unsigned cpus) + } + + for (unsigned int i = 0; i < cpus; ++i) { ++ cpu_infos[i].ce_nums = 0; ++ cpu_infos[i].uce_nums = 0; + cpu_infos[i].state = get_cpu_status(i); + cpu_infos[i].ce_queue = init_queue(); + if (cpu_infos[i].ce_queue == NULL) { +@@ -384,6 +386,8 @@ void ras_record_cpu_error(struct error_info *err_info, int cpu) + log(TERM, LOG_INFO, "Offline cpu%d succeed, the state is %s\n", + cpu, cpu_state[cpu_infos[cpu].state]); + clear_queue(cpu_infos[cpu].ce_queue); ++ cpu_infos[cpu].ce_nums = 0; ++ cpu_infos[cpu].uce_nums = 0; + } + else { + log(TERM, LOG_INFO, "Offline cpu%d fail, the state is %s\n", +-- +2.27.0 + diff --git a/rasdaemon.spec b/rasdaemon.spec index 81843b03c842fa2a1ef8984dab0e03b42ef0fcc4..ed6228521c3060e1ce1b94db37a6b4ce4ddac7a2 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.6.6 -Release: 7 +Release: 8 License: GPLv2 Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events URL: https://github.com/mchehab/rasdaemon.git @@ -36,6 +36,7 @@ Patch14: 0006-add-cpu-online-fault-isolation.patch Patch15: 0007-add-trace-print-and-add-sqlite-store.patch Patch16: 0008-modify-cpu-parse-for-adapting-to-new-bios-version.patch Patch17: bugfix-modify-the-way-counting-cpu-logical-index.patch +Patch18: bugfix-fix-where-local-variables-are-not-initialized.patch %description The rasdaemon program is a daemon which monitors the platform @@ -82,6 +83,13 @@ rm INSTALL %{buildroot}/usr/include/*.h /usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Wed Dec 15 2021 luoshengwei - 0.6.6-8 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Add initialization to some local variables when they are cleaned +- or defined. + * Wed Dec 1 2021 luoshengwei - 0.6.6-7 - Type:bugfix - ID:NA