Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1267090
| From | Wang Nan <wangnan0@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] perf probe: Clear probe_trace_event when probe_trace_event failure |
| Date | 2015-11-11 11:30 +0100 |
| Message-ID | <qtAP8-1we-9@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
When failure occures in add_probe_trace_event(), to avoid potential dangling pointer and memory leak, resource attached to 'struct probe_trace_event' should be cleared. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com --- tools/perf/util/probe-finder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index bd8f03d..e9e37ca 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1235,6 +1235,8 @@ static int add_probe_trace_event(Dwarf_Die *sc_die, struct probe_finder *pf) end: free(args); + if (ret) + clear_probe_trace_event(tev); return ret; } -- 1.8.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] perf probe: Clear probe_trace_event when probe_trace_event failure Wang Nan <wangnan0@huawei.com> - 2015-11-11 11:30 +0100 RE: [PATCH] perf probe: Clear probe_trace_event when probe_trace_event failure 平松雅巳 / HIRAMATU,MASAMI <masami.hiramatsu.pt@hitachi.com> - 2015-11-11 15:50 +0100
csiph-web