Add missing rcu_read_unlock on error paths
[lttng-tools.git] / liblttng-consumer / lttng-consumer.c
index 081d6142b2d76505f3f4de4520654380d3c220cc..2fcb39a27290ea2d1f9a060948df6252698deaf8 100644 (file)
@@ -125,10 +125,11 @@ void consumer_del_stream(struct lttng_consumer_stream *stream)
        if (stream->out_fd >= 0) {
                close(stream->out_fd);
        }
-       if (stream->wait_fd >= 0) {
+       if (stream->wait_fd >= 0 && !stream->wait_fd_is_copy) {
                close(stream->wait_fd);
        }
-       if (stream->shm_fd >= 0 && stream->wait_fd != stream->shm_fd) {
+       if (stream->shm_fd >= 0 && stream->wait_fd != stream->shm_fd
+                       && !stream->shm_fd_is_copy) {
                close(stream->shm_fd);
        }
        if (!--stream->chan->refcount)
@@ -180,6 +181,7 @@ struct lttng_consumer_stream *consumer_allocate_stream(
        case LTTNG_CONSUMER_KERNEL:
                break;
        case LTTNG_CONSUMER_UST:
+               stream->cpu = stream->chan->cpucount++;
                ret = lttng_ustconsumer_allocate_stream(stream);
                if (ret) {
                        free(stream);
@@ -282,10 +284,11 @@ void consumer_del_channel(struct lttng_consumer_channel *channel)
                        perror("munmap");
                }
        }
-       if (channel->wait_fd >= 0) {
+       if (channel->wait_fd >= 0 && !channel->wait_fd_is_copy) {
                close(channel->wait_fd);
        }
-       if (channel->shm_fd >= 0 && channel->wait_fd != channel->shm_fd) {
+       if (channel->shm_fd >= 0 && channel->wait_fd != channel->shm_fd
+                       && !channel->shm_fd_is_copy) {
                close(channel->shm_fd);
        }
        free(channel);
This page took 0.024692 seconds and 4 git commands to generate.