From: Mathieu Desnoyers Date: Tue, 4 Jun 2019 18:59:26 +0000 (-0400) Subject: Fix: ring_buffer_frontend.c: init read timer with uninitialized flags X-Git-Tag: v2.12.0-pre~41 X-Git-Url: http://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=b1ad8713157e5aa610c20a7f67d81e04689f151a Fix: ring_buffer_frontend.c: init read timer with uninitialized flags For the config->alloc RING_BUFFER_ALLOC_GLOBAL (metadata channel), the read timer flags argument is uninitialized. Found by Coverity: CID 1401114 (#1 of 1): Uninitialized scalar variable (UNINIT) 6. uninit_use_in_call: Using uninitialized value flags when calling init_timer_key. Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index fe5b8366..90c665d6 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -407,7 +407,7 @@ static void lib_ring_buffer_start_read_timer(struct lib_ring_buffer *buf) { struct channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; - unsigned int flags; + unsigned int flags = 0; if (config->wakeup != RING_BUFFER_WAKEUP_BY_TIMER || !chan->read_timer_interval