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.11.0-rc5~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8ed66080397eac7fe638dac8a2fd3fcaefd83988;p=lttng-modules.git 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