Fix: Unbalanced rcu_read_unlock() on stream file creation failure
[lttng-tools.git] / src / bin / lttng-relayd / connection.c
index f8315449a31052264847a608a5ef1a399c4ddf12..76e48a6ab7762a11b1ead8a0fb09c854e3ceb1e5 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <common/common.h>
 
 #include "connection.h"
@@ -31,6 +32,10 @@ static void rcu_free_connection(struct rcu_head *head)
        connection_free(conn);
 }
 
+/*
+ * Must be called with a read side lock held. The read side lock must be
+ * kept until the returned relay_connection is no longer in use.
+ */
 struct relay_connection *connection_find_by_sock(struct lttng_ht *ht, int sock)
 {
        struct lttng_ht_node_ulong *node;
@@ -67,16 +72,8 @@ void connection_delete(struct lttng_ht *ht, struct relay_connection *conn)
 
 void connection_destroy(struct relay_connection *conn)
 {
-       struct relay_stream *stream, *tmp_stream;
-
        assert(conn);
 
-       /* Clean up recv list of this connection if any. */
-       cds_list_for_each_entry_safe(stream, tmp_stream, &conn->recv_head,
-                       recv_list) {
-               cds_list_del(&stream->recv_list);
-       }
-
        call_rcu(&conn->rcu_node, rcu_free_connection);
 }
 
This page took 0.024533 seconds and 4 git commands to generate.