From 03304e370fdf281fef8df4a0faa2bc3d1d15eadc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 16 Oct 2019 12:35:23 -0400 Subject: [PATCH] Fix: consumer: double unlock of rcu read lock on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Commit 6b584c2e changed the implementation of the "trace_chunk_exists" command to use the then-new "exists" method of the trace chunk registry. Before this change, the trace chunks were looked-up to check for their existence. Since the "exists" method doesn't require the caller to hold the rcu read lock, it is acquired later on in the function. However, the rcu read lock is still released on error when this function fails, resulting in a double-unlock. Signed-off-by: Jérémie Galarneau --- src/common/consumer/consumer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 0086d748f..09f0f0983 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -4801,7 +4801,7 @@ enum lttcomm_return_code lttng_consumer_trace_chunk_exists( /* Internal error. */ ERR("Failed to query the existence of a trace chunk"); ret_code = LTTCOMM_CONSUMERD_FATAL; - goto end_rcu_unlock; + goto end; } DBG("Trace chunk %s locally", chunk_exists_local ? "exists" : "does not exist"); -- 2.34.1