Fix: add missing rcu read side lock
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index e5a22460fc3c6fe2342bf82d015d6da84a85ffd2..339b20d3ee433be2d17f33d3462b104ab6266448 100644 (file)
@@ -638,7 +638,7 @@ static int update_kernel_stream(struct consumer_data *consumer_data, int fd)
                                        struct lttng_ht_iter iter;
                                        struct consumer_socket *socket;
 
                                        struct lttng_ht_iter iter;
                                        struct consumer_socket *socket;
 
-
+                                       rcu_read_lock();
                                        cds_lfht_for_each_entry(ksess->consumer->socks->ht,
                                                        &iter.iter, socket, node.node) {
                                                /* Code flow error */
                                        cds_lfht_for_each_entry(ksess->consumer->socks->ht,
                                                        &iter.iter, socket, node.node) {
                                                /* Code flow error */
@@ -649,9 +649,11 @@ static int update_kernel_stream(struct consumer_data *consumer_data, int fd)
                                                                channel, ksess);
                                                pthread_mutex_unlock(socket->lock);
                                                if (ret < 0) {
                                                                channel, ksess);
                                                pthread_mutex_unlock(socket->lock);
                                                if (ret < 0) {
+                                                       rcu_read_unlock();
                                                        goto error;
                                                }
                                        }
                                                        goto error;
                                                }
                                        }
+                                       rcu_read_unlock();
                                }
                                goto error;
                        }
                                }
                                goto error;
                        }
This page took 0.031838 seconds and 4 git commands to generate.