Fix: ring_buffer_frontend.c: init read timer with uninitialized flags
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 Jun 2019 18:59:26 +0000 (14:59 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 Jun 2019 19:00:53 +0000 (15:00 -0400)
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 <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_frontend.c

index fe5b8366be1c5e0aedd7402d30a7dcb35f1c05e2..90c665d6e7104c186cfe12ef63bdd399b13ba16e 100644 (file)
@@ -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
This page took 0.026504 seconds and 4 git commands to generate.