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:56 +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 19b0036546c87723ebdc7027f0696f06d6fcbaa2..60725f18e2dbd5c174ca86429dea10f7c138143d 100644 (file)
@@ -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
This page took 0.02686 seconds and 4 git commands to generate.