From: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
To: lttng-dev@lists.lttng.org
Cc: jgalar@efficios.com
Subject: [PATCH lttng-tools] Fix: Move initialization of queue_pipe_fd after null check of handle
Date: Fri, 20 Sep 2019 11:07:55 -0400 [thread overview]
Message-ID: <20190920150756.7959-1-jonathan.rajotte-julien__47475.0937473559$1568992100$gmane$org@efficios.com> (raw)
Fixes coverity #1399732
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
---
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
next reply other threads:[~2019-09-20 15:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 15:07 Jonathan Rajotte [this message]
[not found] <20190920150756.7959-1-jonathan.rajotte-julien@efficios.com>
2019-09-20 21:32 ` [PATCH lttng-tools] Fix: Move initialization of queue_pipe_fd after null check of handle Jérémie Galarneau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='20190920150756.7959-1-jonathan.rajotte-julien__47475.0937473559$1568992100$gmane$org@efficios.com' \
--to=jonathan.rajotte-julien@efficios.com \
--cc=jgalar@efficios.com \
--cc=lttng-dev@lists.lttng.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).