diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ae6fa2d1cdf7dd75dd7e9aa4cfb66bcb32192315..4d79485b3237597a3657b3f2b98b4fca1f40d3a6 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6216,10 +6216,15 @@ __init static int tracer_alloc_buffers(void) trace_init_cmdlines(); - register_tracer(&nop_trace); - + /* + * register_tracer() might reference current_trace, so it + * needs to be set before we register anything. This is + * just a bootstrap of current_trace anyway. + */ global_trace.current_trace = &nop_trace; + register_tracer(&nop_trace); + /* All seems OK, enable tracing */ tracing_disabled = 0;