tracing/osnoise: Call synchronize_rcu() when unregistering

This ensures that any RCU readers traversing the instance list
have finished, before releasing the reference on the tracer that
the instance points to.

Cc: stable@vger.kernel.org
Fixes: a6ed2aee54 ("tracing: Switch to kvfree_rcu() API")
Link: https://patch.msgid.link/20260609045430.1589786-1-crwood@redhat.com
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Crystal Wood <crwood@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
Crystal Wood
2026-06-08 23:54:30 -05:00
committed by Steven Rostedt
parent c37e0a4b79
commit fe58f457ad

View File

@@ -179,7 +179,9 @@ static void osnoise_unregister_instance(struct trace_array *tr)
if (!found)
return;
kvfree_rcu_mightsleep(inst);
/* Do a full sync to ensure that tr remains valid, not just inst */
synchronize_rcu();
kvfree(inst);
}
/*