From: Wang Nan <wangnan0@huawei.com>
To: <acme@kernel.org>
Cc: <lizefan@huawei.com>, <pi3orama@163.com>,
<linux-kernel@vger.kernel.org>, Wang Nan <wangnan0@huawei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH] perf probe: Clear probe_trace_event when probe_trace_event failure
Date: Wed, 11 Nov 2015 10:19:43 +0000 [thread overview]
Message-ID: <1447237183-106610-1-git-send-email-wangnan0@huawei.com> (raw)
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
next reply other threads:[~2015-11-11 10:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 10:19 Wang Nan [this message]
2015-11-11 14:46 ` 平松雅巳 / HIRAMATU,MASAMI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447237183-106610-1-git-send-email-wangnan0@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=pi3orama@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®