]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tracing/uprobe: Fix uprobe_perf_open probes iteration
authorJiri Olsa <jolsa@redhat.com>
Tue, 23 Nov 2021 14:28:01 +0000 (15:28 +0100)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 24 Nov 2021 01:52:01 +0000 (20:52 -0500)
Add missing 'tu' variable initialization in the probes loop,
otherwise the head 'tu' is used instead of added probes.

Link: https://lkml.kernel.org/r/20211123142801.182530-1-jolsa@kernel.org
Cc: stable@vger.kernel.org
Fixes: 24a3092d6387 ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_uprobe.c

index 0a5c0db3137ee9f7c04c464f9b5d9a45dd64aa96..f5f0039d31e5aa9edda0344dd271e90f1d2f4c15 100644 (file)
@@ -1313,6 +1313,7 @@ static int uprobe_perf_open(struct trace_event_call *call,
                return 0;
 
        list_for_each_entry(pos, trace_probe_probe_list(tp), list) {
+               tu = container_of(pos, struct trace_uprobe, tp);
                err = uprobe_apply(tu->inode, tu->offset, &tu->consumer, true);
                if (err) {
                        uprobe_perf_close(call, event);