mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
tracing/kprobe: Release kprobe print_fmt properly
We don't release tk->tp.call.print_fmt when destroying
local uprobe. Also there's missing print_fmt kfree in
create_local_trace_kprobe error path.
Link: http://lkml.kernel.org/r/[email protected]
Cc: [email protected]
Fixes: e12f03d703 ("perf/core: Implement the 'perf_kprobe' PMU")
Acked-by: Song Liu <[email protected]>
Acked-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
This commit is contained in:
parent
1fe4293f4b
commit
0fc8c3581d
1 changed files with 5 additions and 1 deletions
|
|
@ -1480,8 +1480,10 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
|
|||
}
|
||||
|
||||
ret = __register_trace_kprobe(tk);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
kfree(tk->tp.call.print_fmt);
|
||||
goto error;
|
||||
}
|
||||
|
||||
return &tk->tp.call;
|
||||
error:
|
||||
|
|
@ -1501,6 +1503,8 @@ void destroy_local_trace_kprobe(struct trace_event_call *event_call)
|
|||
}
|
||||
|
||||
__unregister_trace_kprobe(tk);
|
||||
|
||||
kfree(tk->tp.call.print_fmt);
|
||||
free_trace_kprobe(tk);
|
||||
}
|
||||
#endif /* CONFIG_PERF_EVENTS */
|
||||
|
|
|
|||
Loading…
Reference in a new issue