X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-abi.c;h=0c41dc3b405518ffc718ea3cf0750209a3c162da;hb=4baabfe378c1ed249d43d70275854788474fb714;hp=b0b638d4f5f61168004a5d2b95e75428a1273345;hpb=695b350946040f9cce3888826981b7210ab04b48;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index b0b638d4..0c41dc3b 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -984,8 +984,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); } @@ -1137,8 +1141,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: