tracing: Check if tracing is enabled in trace_puts()
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Thu, 23 Jan 2014 17:27:59 +0000 (12:27 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:50:09 +0000 (13:50 -0800)
commit8c0b860ecba3c32e8c784bb6840363301f6a1fe3
tree2225bdd5efcfc5950e0ec8be03f4b0b88fbb5393
parentf01b215f5a9e3eb922a64be93220f68b43c5b205
tracing: Check if tracing is enabled in trace_puts()

commit 3132e107d608f8753240d82d61303c500fd515b4 upstream.

If trace_puts() is used very early in boot up, it can crash the machine
if it is called before the ring buffer is allocated. If a trace_printk()
is used with no arguments, then it will be converted into a trace_puts()
and suffer the same fate.

Fixes: 09ae72348ecc "tracing: Add trace_puts() for even faster trace_printk() tracing"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace.c