lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH lttng-tools] Fix: Move initialization of queue_pipe_fd after null check of handle
       [not found] <20190920150756.7959-1-jonathan.rajotte-julien@efficios.com>
@ 2019-09-20 21:32 ` Jérémie Galarneau
  0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2019-09-20 21:32 UTC (permalink / raw)
  To: Jonathan Rajotte; +Cc: lttng-dev, jgalar

Merged in master and stable-2.11, but slightly modified to drop the
'const' qualifier and maintain the convention of declaring variables
at the earliest point in the scope.

Thanks!
Jérémie

On Fri, Sep 20, 2019 at 11:07:55AM -0400, Jonathan Rajotte wrote:
> 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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH lttng-tools] Fix: Move initialization of queue_pipe_fd after null check of handle
@ 2019-09-20 15:07 Jonathan Rajotte
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Rajotte @ 2019-09-20 15:07 UTC (permalink / raw)
  To: lttng-dev; +Cc: jgalar

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-20 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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
2019-09-20 15:07 Jonathan Rajotte

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).