From mboxrd@z Thu Jan 1 00:00:00 1970 From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte) Date: Fri, 20 Sep 2019 11:07:55 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Move initialization of queue_pipe_fd after null check of handle Message-ID: <20190920150756.7959-1-jonathan.rajotte-julien@efficios.com> Fixes coverity #1399732 Signed-off-by: Jonathan Rajotte --- src/bin/lttng-sessiond/rotation-thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 7bd6c6819..1ee3974f0 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -832,8 +832,6 @@ 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); DBG("[rotation-thread] Started rotation thread"); @@ -842,6 +840,10 @@ void *thread_rotation(void *data) goto end; } + /* Must be after null checking of handle for const assignment */ + const int queue_pipe_fd = lttng_pipe_get_readfd( + handle->rotation_timer_queue->event_pipe); + rcu_register_thread(); rcu_thread_online(); -- 2.17.1