Fix: lttng lttng.c: check strdup OOM
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 46113cf5e94c5abdd6b2e6051ba9a8c8e0b076fa..0b792d76191b52d853ef73ade4ec7081062dc9ef 100644 (file)
@@ -1989,6 +1989,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
@@ -5152,10 +5153,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.03593 seconds and 4 git commands to generate.