Commit 55a00055 authored by Vincent Donnefort's avatar Vincent Donnefort Committed by Steven Rostedt
Browse files

tracing: Fix desc in error path for the trace remote test module

During initialisation in remote_test_load(), if one of the
simple_ring_buffer fails to initialise, the error path attempts to
rollback initialised buffers. However, the rollback incorrectly uses the
global pointer to the trace descriptor, which is only set upon
successful load completion. Fix the error path by using the local
pointer to the descriptor.

Link: https://patch.msgid.link/20260515201616.337469-1-vdonnefort@google.com


Fixes: ea908a2b ("tracing: Add a trace remote module for testing")
Reported-by: default avatarSashiko <sashiko-bot@kernel.org>
Signed-off-by: default avatarVincent Donnefort <vdonnefort@google.com>

base-commit: 5d691905
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 96350db8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -110,9 +110,9 @@ static struct trace_buffer_desc *remote_test_load(unsigned long size, void *unus
	return remote_test_buffer_desc;

err_unload:
	for_each_ring_buffer_desc(rb_desc, cpu, remote_test_buffer_desc)
	for_each_ring_buffer_desc(rb_desc, cpu, desc)
		remote_test_unload_simple_rb(rb_desc->cpu);
	trace_remote_free_buffer(remote_test_buffer_desc);
	trace_remote_free_buffer(desc);

err_free_desc:
	kfree(desc);