Fix: uninitialized variable in lib_ring_buffer_channel_switch_timer_start
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 25 Feb 2021 17:40:48 +0000 (12:40 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 25 Feb 2021 17:42:12 +0000 (12:42 -0500)
Found by Coverity:
** CID 1447027:  Uninitialized variables  (UNINIT)
/libringbuffer/ring_buffer_frontend.c: 810 in lib_ring_buffer_channel_switch_timer_start()

>>>     CID 1447027:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "sev". Field "sev._sigev_un" is uninitialized when calling "timer_create".

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iaa66e5612ff1c51b50c4c0b8f30f3695e1b03153

libringbuffer/ring_buffer_frontend.c

index dfbb23a9aa1080af53023186881e64e271edeae2..fd11a9a7452d9cca0cdeb76d9da33db8eb9ba3cd 100644 (file)
@@ -804,6 +804,7 @@ void lib_ring_buffer_channel_switch_timer_start(struct channel *chan)
 
        lib_ring_buffer_setup_timer_thread();
 
+       memset(&sev, 0, sizeof(sev));
        sev.sigev_notify = SIGEV_SIGNAL;
        sev.sigev_signo = LTTNG_UST_RB_SIG_FLUSH;
        sev.sigev_value.sival_ptr = chan;
This page took 0.026085 seconds and 4 git commands to generate.