X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fsession.c;h=46d9cc66a587cfe6bbbb4520998e605217295e74;hb=330a40bb375c4f97ccd4ad556907830f878f22cb;hp=02cc748e75f6fd8f25f3cf5e47623d7523c1affb;hpb=2a174661a1e0ab551b41ff1cae7191688525fc1f;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/session.c b/src/bin/lttng-relayd/session.c index 02cc748e7..46d9cc66a 100644 --- a/src/bin/lttng-relayd/session.c +++ b/src/bin/lttng-relayd/session.c @@ -17,6 +17,7 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include "ctf-trace.h" @@ -52,6 +53,7 @@ struct relay_session *session_create(void) session->ctf_traces_ht = lttng_ht_new(0, LTTNG_HT_TYPE_STRING); if (!session->ctf_traces_ht) { free(session); + session = NULL; goto error; } @@ -152,6 +154,9 @@ void session_try_destroy(struct lttng_ht *ht, struct relay_session *session) /* * Destroy a session object. + * + * This function must *NOT* be called with an RCU read lock held since + * the session's ctf_traces_ht is destroyed. */ void session_destroy(struct relay_session *session) { @@ -172,8 +177,8 @@ void session_destroy(struct relay_session *session) ctf_trace_delete(session->ctf_traces_ht, ctf_trace); ctf_trace_destroy(ctf_trace); } - lttng_ht_destroy(session->ctf_traces_ht); rcu_read_unlock(); + lttng_ht_destroy(session->ctf_traces_ht); call_rcu(&session->rcu_node, rcu_destroy_session); }