Re: [PATCH v2] tracing: Fix crash passing ERR_PTR to kthread_stop()

From
Steven Rostedt <rostedt@goodmis.org>
Date
2026-08-17 13:26:46
Also in
sashiko-reviews
Reply to
sashiko-bot@kernel.org, 2026-08-17
On Mon, 17 Aug 2026 12:15:32 +0000
sashiko-bot@kernel.org wrote:
quoted
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 0356cae0cf74e..9e941e5805f5e 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -3866,6 +3866,8 @@ static __init void event_test_stuff(void)
 	struct task_struct *test_thread;
 
 	test_thread = kthread_run(event_test_thread, NULL, "test-events");
+	if (WARN_ON(IS_ERR(test_thread)))
+		return;  
[Severity: High]
Does this risk causing a console flood and soft lockup if thread creation
persistently fails?
If that happens than the system is doomed to begin with. We don't care
here. This patch is good enough. It's for a debugging feature, not
anything that would be run in production.

Just look at the name of the function: event_test_stuff()

This is where AI has a hard time with subtle requirements.

Thanks,

-- Steve
Thread (3 messages) 3 messages, 3 authors, last reply 2026-08-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help