mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 03:27:30 -04:00
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:
committed by
Steven Rostedt
parent
c37e0a4b79
commit
fe58f457ad
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user