Commit c91afa76 authored by Masami Hiramatsu (Google)'s avatar Masami Hiramatsu (Google)
Browse files

tracing: tprobe-events: Fix to put tracepoint_user when disable the tprobe

__unregister_trace_fprobe() checks tf->tuser to put it when removing
tprobe. However, disable_trace_fprobe() does not use it and only calls
unregister_fprobe(). Thus it forgets to disable tracepoint_user.

If the trace_fprobe has tuser, put it for unregistering the tracepoint
callbacks when disabling tprobe correctly.

Link: https://lore.kernel.org/all/176244794466.155515.3971904050506100243.stgit@devnote2/



Fixes: 2867495d ("tracing: tprobe-events: Register tracepoint when enable tprobe event")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tested-by: default avatarBeau Belgrave <beaub@linux.microsoft.com>
Reviewed-by: default avatarBeau Belgrave <beaub@linux.microsoft.com>
parent 10d9dda4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1514,6 +1514,10 @@ static int disable_trace_fprobe(struct trace_event_call *call,
	if (!trace_probe_is_enabled(tp)) {
		list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
			unregister_fprobe(&tf->fp);
			if (tf->tuser) {
				tracepoint_user_put(tf->tuser);
				tf->tuser = NULL;
			}
		}
	}