[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-26dee028d365fbc0e3326606a8520260b4462381@git.kernel.org>
Date: Sat, 20 Feb 2016 03:36:27 -0800
From: tip-bot for Wang Nan <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, hekuang@...wei.com, tglx@...utronix.de,
masami.hiramatsu.pt@...achi.com, wangnan0@...wei.com,
jolsa@...nel.org, ast@...nel.org, acme@...hat.com, dev@...yps.com,
namhyung@...nel.org, jeremie.galarneau@...icios.com,
adrian.hunter@...el.com, linux-kernel@...r.kernel.org,
lizefan@...wei.com, brendan.d.gregg@...il.com, hpa@...or.com,
peterz@...radead.org, kirr@...edi.com
Subject: [tip:perf/core] perf tools: Fix checking asprintf return value
Commit-ID: 26dee028d365fbc0e3326606a8520260b4462381
Gitweb: http://git.kernel.org/tip/26dee028d365fbc0e3326606a8520260b4462381
Author: Wang Nan <wangnan0@...wei.com>
AuthorDate: Fri, 19 Feb 2016 11:43:52 +0000
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 19 Feb 2016 19:12:47 -0300
perf tools: Fix checking asprintf return value
According to man pages, asprintf returns -1 when failure. This patch
fixes two incorrect return value checker.
Signed-off-by: Wang Nan <wangnan0@...wei.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Brendan Gregg <brendan.d.gregg@...il.com>
Cc: Cody P Schafer <dev@...yps.com>
Cc: He Kuang <hekuang@...wei.com>
Cc: Jeremie Galarneau <jeremie.galarneau@...icios.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Kirill Smelkov <kirr@...edi.com>
Cc: Li Zefan <lizefan@...wei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Zefan Li <lizefan@...wei.com>
Cc: pi3orama@....com
Cc: stable@...r.kernel.org # v4.4+
Fixes: ffeb883e5662 ("perf tools: Show proper error message for wrong terms of hw/sw events")
Link: http://lkml.kernel.org/r/1455882283-79592-5-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/parse-events.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e5583fd..72524c7 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2110,11 +2110,11 @@ char *parse_events_formats_error_string(char *additional_terms)
/* valid terms */
if (additional_terms) {
- if (!asprintf(&str, "valid terms: %s,%s",
- additional_terms, static_terms))
+ if (asprintf(&str, "valid terms: %s,%s",
+ additional_terms, static_terms) < 0)
goto fail;
} else {
- if (!asprintf(&str, "valid terms: %s", static_terms))
+ if (asprintf(&str, "valid terms: %s", static_terms) < 0)
goto fail;
}
return str;
Powered by blists - more mailing lists