X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=64ea99da27fc6e126358f223f25972d74bac301f;hb=e0d82ce5441766ce266878f0638981e51002523e;hp=0996f2f198532924704266d6014ab98cd1f55318;hpb=3780dda998147e51885d861b1e458dee3f783ff6;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index 0996f2f1..64ea99da 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -1090,8 +1090,12 @@ int lttng_metadata_ring_buffer_release(struct inode *inode, struct file *file) struct lttng_metadata_stream *stream = file->private_data; struct lib_ring_buffer *buf = stream->priv; + mutex_lock(&stream->metadata_cache->lock); + list_del(&stream->list); + mutex_unlock(&stream->metadata_cache->lock); kref_put(&stream->metadata_cache->refcount, metadata_cache_destroy); module_put(stream->transport->owner); + kfree(stream); return lib_ring_buffer_release(inode, file, buf); } @@ -1243,8 +1247,10 @@ int lttng_abi_open_metadata_stream(struct file *channel_file) if (ret < 0) goto fd_error; + mutex_lock(&session->metadata_cache->lock); list_add(&metadata_stream->list, &session->metadata_cache->metadata_stream); + mutex_unlock(&session->metadata_cache->lock); return ret; fd_error: