Fix: consumer: unbalanced RCU read-side lock on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 27 May 2021 20:45:55 +0000 (16:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 May 2021 23:28:55 +0000 (19:28 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I22ddc8585af84d07e8f3d19e9df582599352a1b8

src/common/consumer/consumer-stream.c

index 47f2eb2171fa2883d84ce8a7dfe8830fa10134fb..2fda11301c55493bb8a71e1d64b7b36c8bf564b6 100644 (file)
@@ -479,13 +479,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.027089 seconds and 4 git commands to generate.