Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1653902

Re: [PATCH v2] perf: fix double free at function perf_hpp__reset_output_field

From "Du, Changbin" <changbin.du@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] perf: fix double free at function perf_hpp__reset_output_field
Date 2017-05-31 09:20 +0200
Message-ID <tN65b-1H4-15@gated-at.bofh.it> (permalink)
References (5 earlier) <tuZlw-4vi-7@gated-at.bofh.it> <tv13Y-5FJ-7@gated-at.bofh.it> <tv13Y-5FJ-5@gated-at.bofh.it> <tv1nk-5Mx-15@gated-at.bofh.it> <tvfJD-6AM-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi jirka, Will you send a patch to fix this issue? If not I will send my
solution in a new thread.

I have given up to add 'dynamic sort' feature since my code is not working
and I am engaged in other things. I still hope this fix can be picked up.
Thanks!

On Wed, Apr 12, 2017 at 09:48:08AM +0800, Du, Changbin wrote:
> On Tue, Apr 11, 2017 at 12:32:49PM +0200, Jiri Olsa wrote:
> > On Tue, Apr 11, 2017 at 06:13:17PM +0800, Du, Changbin wrote:
> > > > > >  
> > > > > yes, this is an option. But for safety, I sugguest do not rely on list_del_init.
> > > > > No rule rather than create one.
> > > > > 
> > > > > But anyway, both are ok for me. What's your options?
> > > > 
> > > > hum, also I dont think we need to touch that bit at all
> > > > if we are going to remove it right away.. how about the
> > > > change below?
> > > > 
> > > > jirka
> > > > 
> > > > 
> > > > ---
> > > > diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
> > > > index 5d632dca672a..0ee7db43dd7d 100644
> > > > --- a/tools/perf/ui/hist.c
> > > > +++ b/tools/perf/ui/hist.c
> > > > @@ -613,15 +613,15 @@ void perf_hpp__reset_output_field(struct perf_hpp_list *list)
> > > >  
> > > >  	/* reset output fields */
> > > >  	perf_hpp_list__for_each_format_safe(list, fmt, tmp) {
> > > > -		list_del_init(&fmt->list);
> > > > -		list_del_init(&fmt->sort_list);
> > > > +		list_del(&fmt->list);
> > > > +		/* Remove the fmt from next loop processing. */
> > > > +		list_del(&fmt->sort_list);
> > > >  		fmt_free(fmt);
> > > What if the fmt is not linked to sort_list? I see it is possible (please
> > > checking perf_hpp__setup_output_field()). I am not sure if we really has
> > > sunch case currently, just concern :)
> > 
> > if it's not linked to sort_list, then sort_list is initialized
> > and list_del should do no harm
> > 
> ok, then it's fine if you insist.
> 
> > jirka
> 
> -- 
> Thanks,
> Changbin Du



-- 
Thanks,
Changbin Du

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2] perf: fix double free at function  perf_hpp__reset_output_field "Du, Changbin" <changbin.du@intel.com> - 2017-05-31 09:20 +0200
  Re: [PATCH v2] perf: fix double free at function  perf_hpp__reset_output_field Jiri Olsa <jolsa@redhat.com> - 2017-05-31 09:20 +0200

csiph-web