Skip to contentSkip to conversation

rasdaemon: ARM: fully initialize ras_arm_event

PATCH Aristeu Rozanski 1 participant 1 message Feb 2, 2018 EDAC-core

lore
Share & tools
lore
#0 lore raw

Issue found by covscan:

1. rasdaemon-0.4.1/ras-arm-handler.c:32: var_decl: Declaring variable "ev" without initializer.
16. rasdaemon-0.4.1/ras-arm-handler.c:81: uninit_use_in_call: Using uninitialized value "ev.error_count" when calling "ras_store_arm_record".
23. rasdaemon-0.4.1/ras-record.c:243:2: read_parm_fld: Reading a parameter field.

---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

ras-arm-handler.c +2 -0
index a76470d..2f170e2 100644
@@ -31,6 +31,8 @@ int ras_arm_event_handler(struct trace_seq *s,
 	struct tm *tm;
 	struct ras_arm_event ev;
 
+	memset(&ev, 0, sizeof(ev));
+
 	/*
 	 * Newer kernels (3.10-rc1 or upper) provide an uptime clock.
 	 * On previous kernels, the way to properly generate an event would