All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	Jin Yao <yao.jin@linux.intel.com>
Subject: Re: [PATCH 1/3] perf stat: Check return value of asprintf() properly
Date: Fri, 4 Jun 2021 10:06:08 -0300	[thread overview]
Message-ID: <YLolQAIq3tpC4LTL@kernel.org> (raw)
In-Reply-To: <CAP-5=fVUvsnuayy9pqSUY1tjk9ptw5+QMXZrAwUKLzWD5hKa8g@mail.gmail.com>

Em Thu, Jun 03, 2021 at 09:47:58PM -0700, Ian Rogers escreveu:
> On Wed, Jun 2, 2021 at 2:22 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > It returns -1 on error, so checking with 0 would not work.
> >
> > Fixes: 12279429d862 ("perf stat: Uniquify hybrid event name")
> > Cc: Jin Yao <yao.jin@linux.intel.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied both.

- Arnaldo

 
> Thanks,
> Ian
> 
> > ---
> >  tools/perf/util/stat-display.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> > index b759dfd633b4..04afd41b6067 100644
> > --- a/tools/perf/util/stat-display.c
> > +++ b/tools/perf/util/stat-display.c
> > @@ -564,7 +564,7 @@ static void uniquify_event_name(struct evsel *counter)
> >                                        counter->name, counter->pmu_name);
> >                 }
> >
> > -               if (ret) {
> > +               if (ret > 0) {
> >                         free(counter->name);
> >                         counter->name = new_name;
> >                 }
> > --
> > 2.32.0.rc0.204.g9fa02ecfa5-goog
> >

-- 

- Arnaldo

      reply	other threads:[~2021-06-04 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 21:22 [PATCH 1/3] perf stat: Check return value of asprintf() properly Namhyung Kim
2021-06-02 21:22 ` [PATCH 2/3] perf tools: Clone evsel->use_config_name Namhyung Kim
2021-06-02 21:22 ` [PATCH 3/3] perf stat: Honor event config name on --no-merge Namhyung Kim
2021-06-04  4:47 ` [PATCH 1/3] perf stat: Check return value of asprintf() properly Ian Rogers
2021-06-04 13:06   ` Arnaldo Carvalho de Melo [this message]

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=YLolQAIq3tpC4LTL@kernel.org \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yao.jin@linux.intel.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.