lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [PATCH lttng-ust] Fix: remove uninitialised value
@ 2019-07-29 15:14 Gabriel-Andrew Pollo-Guilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Gabriel-Andrew Pollo-Guilbert @ 2019-07-29 15:14 UTC (permalink / raw)
  To: lttng-dev

Commit 973eac638e4fd introduces an uninitialised value that may prevent
shared memory from being allocated. The compiler didn't give any warning
because the pointer to the value is sent to a function that don't do anything
with it. We simply pass NULL to that function.
---
 liblttng-ust/lttng-ust-comm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c
index 4bc350e2..a299ba84 100644
--- a/liblttng-ust/lttng-ust-comm.c
+++ b/liblttng-ust/lttng-ust-comm.c
@@ -875,17 +875,14 @@ int handle_message(struct sock_info *sock_info,
 	}
 	case LTTNG_UST_STREAM:
 	{
-		uint64_t memory_map_size;
-
 		/* Receive shm_fd, wakeup_fd */
 		ret = ustcomm_recv_stream_from_sessiond(sock,
-			&memory_map_size,
+			NULL,
 			&args.stream.shm_fd,
 			&args.stream.wakeup_fd);
 		if (ret) {
 			goto error;
 		}
-		lum->u.stream.len = memory_map_size;
 
 		if (ops->cmd)
 			ret = ops->cmd(lum->handle, lum->cmd,
-- 
2.22.0

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

* Re: [PATCH lttng-ust] Fix: remove uninitialised value
       [not found] <20190729151426.15105-1-gabriel.pollo-guilbert@efficios.com>
@ 2019-07-29 15:20 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2019-07-29 15:20 UTC (permalink / raw)
  To: Gabriel-Andrew Pollo-Guilbert; +Cc: lttng-dev

Merged into master, 2.11, 2.10, 2.9, thanks!

Mathieu

----- On Jul 29, 2019, at 11:14 AM, Gabriel-Andrew Pollo-Guilbert gabriel.pollo-guilbert@efficios.com wrote:

> Commit 973eac638e4fd introduces an uninitialised value that may prevent
> shared memory from being allocated. The compiler didn't give any warning
> because the pointer to the value is sent to a function that don't do anything
> with it. We simply pass NULL to that function.
> ---
> liblttng-ust/lttng-ust-comm.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c
> index 4bc350e2..a299ba84 100644
> --- a/liblttng-ust/lttng-ust-comm.c
> +++ b/liblttng-ust/lttng-ust-comm.c
> @@ -875,17 +875,14 @@ int handle_message(struct sock_info *sock_info,
> 	}
> 	case LTTNG_UST_STREAM:
> 	{
> -		uint64_t memory_map_size;
> -
> 		/* Receive shm_fd, wakeup_fd */
> 		ret = ustcomm_recv_stream_from_sessiond(sock,
> -			&memory_map_size,
> +			NULL,
> 			&args.stream.shm_fd,
> 			&args.stream.wakeup_fd);
> 		if (ret) {
> 			goto error;
> 		}
> -		lum->u.stream.len = memory_map_size;
> 
> 		if (ops->cmd)
> 			ret = ops->cmd(lum->handle, lum->cmd,
> --
> 2.22.0

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

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

end of thread, other threads:[~2019-07-29 15:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 15:14 [PATCH lttng-ust] Fix: remove uninitialised value Gabriel-Andrew Pollo-Guilbert
     [not found] <20190729151426.15105-1-gabriel.pollo-guilbert@efficios.com>
2019-07-29 15:20 ` Mathieu Desnoyers

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