From: Mathieu Desnoyers Date: Thu, 15 Apr 2021 13:39:30 +0000 (-0400) Subject: Fix: perf counters: uninitialized field X-Git-Tag: v2.13.0-rc1~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2836dd4ff6274876a8709fcc1637e78bbc059cdf;p=lttng-modules.git 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 --- 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;