X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=5bd7621f13ff5c503a55a4e57ada5b5e5678a451;hb=refs%2Fheads%2Fstable-2.5;hp=261a0ad3f8a1bf0ae4af6e76c9a2a246115589b4;hpb=dd5a0db3ea07c46bee3c1814ef7326736f38a06e;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index 261a0ad3..5bd7621f 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -541,9 +541,11 @@ unsigned int lttng_metadata_ring_buffer_poll(struct file *filp, if (finalized) mask |= POLLHUP; + mutex_lock(&stream->metadata_cache->lock); if (stream->metadata_cache->metadata_written > stream->metadata_out) mask |= POLLIN; + mutex_unlock(&stream->metadata_cache->lock); } return mask; @@ -1196,8 +1198,8 @@ int lttng_metadata_channel_release(struct inode *inode, struct file *file) struct lttng_channel *channel = file->private_data; if (channel) { - lttng_metadata_channel_destroy(channel); fput(channel->session->file); + lttng_metadata_channel_destroy(channel); } return 0; @@ -1555,7 +1557,8 @@ error: return ret; } -void __exit lttng_abi_exit(void) +/* No __exit annotation because used by init error path too. */ +void lttng_abi_exit(void) { if (lttng_proc_dentry) remove_proc_entry("lttng", NULL);