bugfix: fix where local variables are not initialized
This commit is contained in:
parent
afcde7da58
commit
5d7e39e8d3
34
bugfix-fix-where-local-variables-are-not-initialized.patch
Normal file
34
bugfix-fix-where-local-variables-are-not-initialized.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From fd8c8d1f66a9058a27c2d1fbfb11225499abebb1 Mon Sep 17 00:00:00 2001
|
||||
From: Lostwayzxc <luoshengwei@huawei.com>
|
||||
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
|
||||
|
||||
@ -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<luoshengwei@huawei.com> - 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<luoshengwei@huawei.com> - 0.6.6-7
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user