lkml.org 
[lkml]   [2020]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/14] perf tools: Add fake pmu support
On Mon, Jun 01, 2020 at 12:22:30AM -0700, Ian Rogers wrote:

SNIP

> > +
> > + list = alloc_list();
> > + if (!list)
> > + YYABORT;
> > +
> > + err = parse_events_add_pmu(_parse_state, list, $1, NULL, false, false);
> > + free($1);
> > + if (err < 0)
>
> nit: on error this needs:
> free(list);
> otherwise something like fuzz testing could go down the error path and
> complain about memory leaks.

right, I'll add that

thanks,
jirka

>
> Thanks,
> Ian
>
> > + YYABORT;
> > + $$ = list;
> > +}
> > +|
> > +PE_PMU_EVENT_FAKE opt_pmu_config
> > +{
> > + struct list_head *list;
> > + int err;
> > +
> > + list = alloc_list();
> > + if (!list)
> > + YYABORT;
> > +
> > + err = parse_events_add_pmu(_parse_state, list, $1, $2, false, false);
> > + free($1);
> > + parse_events_terms__delete($2);
> > + if (err < 0)
> > + YYABORT;
> > + $$ = list;
> > +}
> >
> > value_sym:
> > PE_VALUE_SYM_HW
> > --
> > 2.25.4
> >
>

\
 
 \ /
  Last update: 2020-06-01 11:09    [W:0.545 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site