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.9.13~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=12f7d6d2dc6a6cf41f6692a76d98f1c8bf2bbc05;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 447df3fe..f1fdb062 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -421,7 +421,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