From: Mathieu Desnoyers Date: Thu, 25 Feb 2021 17:40:48 +0000 (-0500) Subject: Fix: uninitialized variable in lib_ring_buffer_channel_switch_timer_start X-Git-Tag: v2.11.4~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ea130eedfa094ea6a433b9dc4d012aa4befe7e5d;p=lttng-ust.git Fix: uninitialized variable in lib_ring_buffer_channel_switch_timer_start 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 Change-Id: Iaa66e5612ff1c51b50c4c0b8f30f3695e1b03153 --- diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index dfbb23a9..fd11a9a7 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -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;