lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7ci_oPsOzRnCiU4PXK7Ye9xT_cTLNshs3P2MTXjxJUcH7Q@mail.gmail.com>
Date:   Thu, 17 Sep 2020 22:27:17 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Stephane Eranian <eranian@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Andi Kleen <ak@...ux.intel.com>,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH v2 1/2] perf parse-event: Release cpu_map if evsel alloc failed

On Thu, Sep 17, 2020 at 10:11 PM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Thu, Sep 17, 2020 at 03:02:18PM +0900, Namhyung Kim wrote:
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> > ---
> >  tools/perf/util/parse-events.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> > index 667cbca1547a..176a51698a64 100644
> > --- a/tools/perf/util/parse-events.c
> > +++ b/tools/perf/util/parse-events.c
> > @@ -360,8 +360,10 @@ __add_event(struct list_head *list, int *idx,
> >               event_attr_init(attr);
> >
> >       evsel = evsel__new_idx(attr, *idx);
> > -     if (!evsel)
> > +     if (!evsel) {
> > +             perf_cpu_map__put(cpus);
>
> if there's pmu defined, we don't we get on perf_cpu_map:
>
>         struct perf_cpu_map *cpus = pmu ? pmu->cpus :
>                                cpu_list ? perf_cpu_map__new(cpu_list) : NULL;

Right, but it's changed in the next patch.  Maybe I need to exchange them.

Thanks
Namhyung


>
> >               return NULL;
> > +     }
> >
> >       (*idx)++;
> >       evsel->core.cpus   = perf_cpu_map__get(cpus);
> > --
> > 2.28.0.618.gf4bc123cb7-goog
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ