X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-stream.c;fp=src%2Fcommon%2Fconsumer%2Fconsumer-stream.c;h=ad0f7024d524f4d82d076d3963d086c93e607b89;hp=37b2d505057c9c470f8892626d211ff634195a39;hb=63e9caa2fa70c49e43b804d176d798db0736906c;hpb=4414cae9a8baf8848ed59024b6542485fa0e26ee diff --git a/src/common/consumer/consumer-stream.c b/src/common/consumer/consumer-stream.c index 37b2d5050..ad0f7024d 100644 --- a/src/common/consumer/consumer-stream.c +++ b/src/common/consumer/consumer-stream.c @@ -629,13 +629,14 @@ struct lttng_consumer_stream *consumer_stream_create( goto end; } + rcu_read_lock(); + if (trace_chunk && !lttng_trace_chunk_get(trace_chunk)) { ERR("Failed to acquire trace chunk reference during the creation of a stream"); ret = -1; goto error; } - rcu_read_lock(); stream->chan = channel; stream->key = stream_key; stream->trace_chunk = trace_chunk;