Fix: agents ht leaks on destroy session
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 784a49ce06f7eb61dd8afa3d8b99bfadaf33c547..891d75f7c000b287a5707e702ef04a972f398ac3 100644 (file)
@@ -1969,6 +1969,7 @@ no_match:
 /*
  * Lookup for an ust app context from an lttng_ust_context.
  *
+ * Must be called while holding RCU read side lock.
  * Return an ust_app_ctx object or NULL on error.
  */
 static
@@ -5151,10 +5152,12 @@ unsigned int ust_app_get_nb_stream(struct ltt_ust_session *usess)
                cds_list_for_each_entry(reg, &usess->buffer_reg_uid_list, lnode) {
                        struct buffer_reg_channel *reg_chan;
 
+                       rcu_read_lock();
                        cds_lfht_for_each_entry(reg->registry->channels->ht, &iter.iter,
                                        reg_chan, node.node) {
                                ret += reg_chan->stream_count;
                        }
+                       rcu_read_unlock();
                }
                break;
        }
This page took 0.024887 seconds and 4 git commands to generate.