From: Namhyung Kim <namhyung@kernel.org>
To: Yasser Shalabi <yassershalabi@gmail.com>
Cc: acme@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
paulus@samba.org, a.p.zijlstra@chello.nl
Subject: Re: [PATCH] perf: fix for double free in tools/perf stat
Date: Tue, 07 Oct 2014 17:15:41 +0900 [thread overview]
Message-ID: <871tqkgus2.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1412437077-13109-1-git-send-email-yassershalabi@gmail.com> (Yasser Shalabi's message of "Sat, 4 Oct 2014 11:37:57 -0400")
Hi Yasser,
On Sat, 4 Oct 2014 11:37:57 -0400, Yasser Shalabi wrote:
> Fix for double free bug in tools/perf due to dangling thread_map pointer in perf_evlist struct.
> Code path excercised when perf stat -C switch is used but not set and is followed by another switch.
> Example: perf stat -C -e.
> Signed-off-by: Yasser Shalabi <yassershalabi@gmail.com>
>
> ---
> tools/perf/util/evlist.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 814e954..09af633 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -845,6 +845,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
>
> out_delete_threads:
> thread_map__delete(evlist->threads);
> + evlist->threads = 0;
Nitpick - I think NULL is preferred rather than 0.
Other than that,
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> return -1;
> }
next prev parent reply other threads:[~2014-10-07 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-04 15:37 Yasser Shalabi
2014-10-07 8:15 ` Namhyung Kim [this message]
2014-10-15 19:17 ` Arnaldo Carvalho de Melo
2014-10-16 5:23 ` [tip:perf/urgent] perf evlist: Fix for double free in tools/ perf stat tip-bot for Yasser Shalabi
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=871tqkgus2.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=yassershalabi@gmail.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
Powered by JetHome