]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Add checks if tr->buffer is NULL in tracing_reset{_online_cpus}
authorHiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
Wed, 19 Dec 2012 07:02:34 +0000 (16:02 +0900)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 21 Jan 2013 18:22:32 +0000 (13:22 -0500)
commiteac8385f24dc97c9597cb3c92dc6372f56a1fd54
tree0e3f73cb2b3fc36397e5b2f3d3d60643f62eb72e
parent09ab379878e8d9d7e1f362dfa4b1b62bddc9856b
tracing: Add checks if tr->buffer is NULL in tracing_reset{_online_cpus}

max_tr->buffer could be NULL in the tracing_reset{_online_cpus}. In this
case, a NULL pointer dereference happens, so we should return immediately
from these functions.

Note, the current code does not call tracing_reset*() with max_tr when
its buffer is NULL, but future code will. This patch is needed to prevent
the future code from crashing.

Link: http://lkml.kernel.org/r/20121219070234.31200.93863.stgit@liselsia
Signed-off-by: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c