All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Yasser Shalabi <yassershalabi@gmail.com>,
	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: Wed, 15 Oct 2014 16:17:25 -0300	[thread overview]
Message-ID: <20141015191725.GQ3198@kernel.org> (raw)
In-Reply-To: <871tqkgus2.fsf@sejong.aot.lge.com>

Em Tue, Oct 07, 2014 at 05:15:41PM +0900, Namhyung Kim escreveu:
> 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.

yeah, I fixed that.
 
> Other than that,
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied!
 
> Thanks,
> Namhyung
> 
> 
> >  	return -1;
> >  }

  reply	other threads:[~2014-10-15 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 15:37 [PATCH] perf: fix for double free in tools/perf stat Yasser Shalabi
2014-10-07  8:15 ` Namhyung Kim
2014-10-15 19:17   ` Arnaldo Carvalho de Melo [this message]
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=20141015191725.GQ3198@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.