tracing/probes: Fix not to count error code to total length
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 11 Jul 2023 14:15:38 +0000 (23:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 11:49:47 +0000 (13:49 +0200)
commit837f92d27f5544468b5b9f3ace6fde5ec965fd53
tree46467a9829d837de74fdf9a8e4bf5f3e33111f96
parent2f41d35b58c896f4b104d31c2f8363b58ae478e4
tracing/probes: Fix not to count error code to total length

commit b41326b5e0f82e93592c4366359917b5d67b529f upstream.

Fix not to count the error code (which is minus value) to the total
used length of array, because it can mess up the return code of
process_fetch_insn_bottom(). Also clear the 'ret' value because it
will be used for calculating next data_loc entry.

Link: https://lore.kernel.org/all/168908493827.123124.2175257289106364229.stgit@devnote2/
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/8819b154-2ba1-43c3-98a2-cbde20892023@moroto.mountain/
Fixes: 9b960a38835f ("tracing: probeevent: Unify fetch_insn processing common part")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_probe_tmpl.h