From 2836dd4ff6274876a8709fcc1637e78bbc059cdf Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 15 Apr 2021 09:39:30 -0400 Subject: [PATCH] Fix: perf counters: uninitialized field Reported by Coverity: ** CID 1452572: Uninitialized variables (UNINIT) >>> Using uninitialized value "ctx_field". Field "ctx_field.get_size_arg" is uninitialized when calling "lttng_kernel_context_append". Signed-off-by: Mathieu Desnoyers Change-Id: I064260c6fe78af24768bb141fde2864d2abbe3a5 --- src/lttng-context-perf-counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lttng-context-perf-counters.c b/src/lttng-context-perf-counters.c index 75be9bf9..e637bb75 100644 --- a/src/lttng-context-perf-counters.c +++ b/src/lttng-context-perf-counters.c @@ -223,7 +223,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, const char *name, struct lttng_kernel_ctx **ctx) { - struct lttng_kernel_ctx_field ctx_field; + struct lttng_kernel_ctx_field ctx_field = { 0 }; struct lttng_kernel_event_field *event_field; struct lttng_perf_counter_field *perf_field; struct perf_event **events; -- 2.34.1