]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Reset parser->buffer to allow multiple "puts"
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 2 Feb 2017 22:58:18 +0000 (17:58 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 3 Feb 2017 15:59:31 +0000 (10:59 -0500)
commit5080dbbddfc9e1a62c8fd0a54414604a075dcbc0
treed980b1f4016c9349987b299c5f61bcbc091ad256
parenteb9f5d5fa5a69a73806abd9912141b56026b088c
tracing: Reset parser->buffer to allow multiple "puts"

trace_parser_put() simply frees the allocated parser buffer. But it does not
reset the pointer that was freed. This means that if trace_parser_put() is
called on the same parser more than once, it will corrupt the allocation
system. Setting parser->buffer to NULL after free allows it to be called
more than once without any ill effect.

Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c