Fix: perf counters: uninitialized field
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Apr 2021 13:39:30 +0000 (09:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Apr 2021 13:40:13 +0000 (09:40 -0400)
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 <mathieu.desnoyers@efficios.com>
Change-Id: I064260c6fe78af24768bb141fde2864d2abbe3a5

src/lttng-context-perf-counters.c

index 75be9bf96491cc7716958bff42225cfef20f8141..e637bb75ca94c3ea2c991871ba2ce40617894f03 100644 (file)
@@ -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;
This page took 0.025793 seconds and 4 git commands to generate.