diff mbox series

[v5,14/22] tracing: Add NULL trace-array check in print_synth_event()

Message ID 157736919742.11126.13760002977641565928.stgit@devnote2 (mailing list archive)
State New, archived
Headers show
Series tracing: bootconfig: Boot-time tracing and Extra boot config | expand

Commit Message

Masami Hiramatsu (Google) Dec. 26, 2019, 2:06 p.m. UTC
Add NULL trace-array check in print_synth_event(), because
if we enable tp_printk option, iter->tr can be NULL.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 0 files changed
diff mbox series

Patch

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index dae2c25b209a..137fc50f2b35 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -833,7 +833,7 @@  static enum print_line_t print_synth_event(struct trace_iterator *iter,
 		fmt = synth_field_fmt(se->fields[i]->type);
 
 		/* parameter types */
-		if (tr->trace_flags & TRACE_ITER_VERBOSE)
+		if (tr && tr->trace_flags & TRACE_ITER_VERBOSE)
 			trace_seq_printf(s, "%s ", fmt);
 
 		snprintf(print_fmt, sizeof(print_fmt), "%%s=%s%%s", fmt);