linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] perf stat: Check return value of asprintf() properly
@ 2021-06-02 21:22 Namhyung Kim
  2021-06-02 21:22 ` [PATCH 2/3] perf tools: Clone evsel->use_config_name Namhyung Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Namhyung Kim @ 2021-06-02 21:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ingo Molnar, Peter Zijlstra, Mark Rutland, Alexander Shishkin,
	LKML, Andi Kleen, Ian Rogers, Jin Yao

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>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-04 13:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).