[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABPqkBRPAFb9ZsbXf8Crz_jarZL6U9NpCJkh=WqVoorUSq_3mw@mail.gmail.com>
Date: Fri, 25 Mar 2022 13:02:01 -0700
From: Stephane Eranian <eranian@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
kim.phillips@....com, acme@...hat.com, jolsa@...hat.com,
songliubraving@...com, rafael@...nel.org, ravi.bangoria@....com,
Sandipan.Das@....com
Subject: Re: [PATCH v7 10/13] perf tools: fix NULL point in evsel__env()
On Fri, Mar 25, 2022 at 11:27 AM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> Em Tue, Mar 22, 2022 at 03:15:14PM -0700, Stephane Eranian escreveu:
> > evsel_env() cannot return NULL. In case evsel->evlist->env is NULL default
> > to perf_env. Fixes crashes in evsel__open_strerror()
> >
> > Signed-off-by: Ravi Bangoria <ravi.bangoria@....com>
> > Reviewed-by: Stephane Eranian <eranian@...gle.com>
>
> I have this already in from a patch by Kim Phillips.
>
Ok, then. We are all set.
> - Arnaldo
>
> > ---
> > tools/perf/util/evsel.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> > index 22d3267ce294..14b0e7ffa2c7 100644
> > --- a/tools/perf/util/evsel.c
> > +++ b/tools/perf/util/evsel.c
> > @@ -2965,7 +2965,7 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target,
> >
> > struct perf_env *evsel__env(struct evsel *evsel)
> > {
> > - if (evsel && evsel->evlist)
> > + if (evsel && evsel->evlist && evsel->evlist->env)
> > return evsel->evlist->env;
> > return &perf_env;
> > }
> > --
> > 2.35.1.894.gb6a874cedc-goog
>
> --
>
> - Arnaldo
Powered by blists - more mailing lists