]> git.ipfire.org Git - thirdparty/linux.git/commit
tracing/mmiotrace: Add NULL check for mmio_trace_array in logging functions
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 28 Jul 2026 12:50:00 +0000 (21:50 +0900)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 29 Jul 2026 18:27:55 +0000 (14:27 -0400)
commit12b80cdbc54cf615b4717a4e8180063408091ea2
tree36915f3a753155d61bb84777d72a4b79ceaeaa47
parentc786d2bdf1f3964deee192ad942dee2a741c1e2c
tracing/mmiotrace: Add NULL check for mmio_trace_array in logging functions

mmio_trace_rw() and mmio_trace_mapping() retrieve mmio_trace_array into
tr and pass it to __trace_mmiotrace_rw() and __trace_mmiotrace_map().
If these functions are invoked while mmio_trace_array is NULL (e.g. before
initialization or after disabled), accessing tr->array_buffer.buffer will
result in a NULL pointer dereference crash.

Fix this by adding an explicit NULL check for tr at the beginning of
__trace_mmiotrace_rw() and __trace_mmiotrace_map().

Link: https://patch.msgid.link/178524300062.56416.8362487250709962380.stgit@devnote2
Fixes: f984b51e0779 ("ftrace: add mmiotrace plugin")
Assisted-by: Antigravity:gemini-3.6-flash
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_mmiotrace.c