From: Jonathan Rajotte Date: Fri, 20 Sep 2019 15:07:55 +0000 (-0400) Subject: Fix: Move initialization of queue_pipe_fd after null check of handle X-Git-Tag: v2.12.0-rc1~361 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=87380d40c7be8994dde5d804f035cb12c368b2c9 Fix: Move initialization of queue_pipe_fd after null check of handle Fixes coverity #1399732 Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 7bd6c6819..2b44036a2 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -832,8 +832,7 @@ void *thread_rotation(void *data) int ret; struct rotation_thread_handle *handle = data; struct rotation_thread thread; - const int queue_pipe_fd = lttng_pipe_get_readfd( - handle->rotation_timer_queue->event_pipe); + int queue_pipe_fd; DBG("[rotation-thread] Started rotation thread"); @@ -842,6 +841,9 @@ void *thread_rotation(void *data) goto end; } + queue_pipe_fd = lttng_pipe_get_readfd( + handle->rotation_timer_queue->event_pipe); + rcu_register_thread(); rcu_thread_online();