tracing/filters: Fix error-handling of cpulist parsing buffer
authorValentin Schneider <vschneid@redhat.com>
Fri, 1 Sep 2023 15:10:36 +0000 (17:10 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 2 Sep 2023 01:27:22 +0000 (21:27 -0400)
commit9af4058493c59721eccd90b7c40cad793e4e3c3b
tree57813982ac73f94a4250292cf42e1b225b844286
parent3d07fa1dd19035eb0b13ae6697efd5caa9033e74
tracing/filters: Fix error-handling of cpulist parsing buffer

parse_pred() allocates a string buffer to parse the user-provided cpulist,
but doesn't check the allocation result nor does it free the buffer once it
is no longer needed.

Add an allocation check, and free the buffer as soon as it is no longer
needed.

Link: https://lkml.kernel.org/r/20230901151039.125186-2-vschneid@redhat.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Reported-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_filter.c