Fix: consumer: unbalanced RCU read-side lock on error
[lttng-tools.git] / src / common / consumer / consumer-stream.c
index 37b2d505057c9c470f8892626d211ff634195a39..ad0f7024d524f4d82d076d3963d086c93e607b89 100644 (file)
@@ -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;
This page took 0.022868 seconds and 4 git commands to generate.