Skip to contentSkip to conversation

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

PATCH New Vincent Donnefort 1 participant 1 message May 15

Subsystems (2)
lore
Share & tools
lore

Vincent Donnefort

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes ea908a2b79c8 ("tracing: Add a trace remote module for testing")
kernel/trace/remote_test.c +2 -2
index 6c1b7701ddae..a3e2c9b606eb 100644
@@ -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);

base-commit: 5d6919055dec134de3c40167a490f33c74c12581

Signature · 1 line
2.54.0.563.g4f69b47b94-goog