]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tracing/probe: Have traceprobe_parse_probe_arg() take a const arg
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 17 Aug 2021 03:42:58 +0000 (23:42 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 18 Aug 2021 22:13:52 +0000 (18:13 -0400)
commitfcd9db51df8e219e3a61b14e9b8c5ee67d39d37c
tree0671bc04f821d0771db6493de20acdffd54c104b
parent1d18538e6a09265003a0a94ca779d7a6127cb76c
tracing/probe: Have traceprobe_parse_probe_arg() take a const arg

The two places that call traceprobe_parse_probe_arg() allocate a temporary
buffer to copy the argv[i] into, because argv[i] is constant and the
traceprobe_parse_probe_arg() will modify it to do the parsing. These two
places allocate this buffer and then free it right after calling this
function, leaving the onus of this allocation to the caller.

As there's about to be a third user of this function that will have to do
the same thing, instead of having the caller allocate the temporary
buffer, simply move that allocation into the traceprobe_parse_probe_arg()
itself, which will simplify the code of the callers.

Link: https://lkml.kernel.org/r/20210817035027.385422828@goodmis.org
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_kprobe.c
kernel/trace/trace_probe.c
kernel/trace/trace_probe.h
kernel/trace/trace_uprobe.c