From: Julien Desfossez Date: Thu, 23 May 2013 23:07:20 +0000 (-0400) Subject: Fix: increment channel refcount on add_stream X-Git-Tag: v2.2.0-rc3~48 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=9d9353f936717527863fda5afcbb89aa459f0852;hp=e43c41c57a0087c782ca0ec29d6613364605d31d Fix: increment channel refcount on add_stream Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index f3a3a22b5..f47c49877 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -255,6 +255,12 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, new_stream->chan = channel; new_stream->wait_fd = fd; + /* Metadata chan refcount is increment in add_metadata_stream */ + if (new_stream->chan->type != CONSUMER_CHANNEL_TYPE_METADATA) { + /* Update channel refcount */ + uatomic_inc(&new_stream->chan->refcount); + } + /* * The buffer flush is done on the session daemon side for the kernel * so no need for the stream "hangup_flush_done" variable to be