tracing: Check the return value of tracing_update_buffers()

In the very unlikely event that tracing_update_buffers() fails in
trace_printk_init_buffers(), report the failure so that it is known.

Link: https://lore.kernel.org/all/[email protected]/

Cc: Mathieu Desnoyers <[email protected]>
Link: https://patch.msgid.link/[email protected]
Suggested-by: Li Zhong <[email protected]>
Acked-by: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
Steven Rostedt
2026-01-26 17:44:40 -05:00
committed by Steven Rostedt (Google)
parent 6a80838814
commit e4ef389e76
+4 -3
View File
@@ -3309,9 +3309,10 @@ void trace_printk_init_buffers(void)
pr_warn("**********************************************************\n");
/* Expand the buffers to set size */
tracing_update_buffers(&global_trace);
buffers_allocated = 1;
if (tracing_update_buffers(&global_trace) < 0)
pr_err("Failed to expand tracing buffers for trace_printk() calls\n");
else
buffers_allocated = 1;
/*
* trace_printk_init_buffers() can be called by modules.