From bb963e16507ca7670f0bb47ccaada8874b2ba6a1 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Fri, 17 Feb 2017 17:17:38 +0900 Subject: perf utils: Check verbose flag properly It now can have negative value to suppress the message entirely. So it needs to check it being positive. Signed-off-by: Namhyung Kim Cc: Jiri Olsa Cc: Peter Zijlstra Cc: kernel-team@lge.com Link: http://lkml.kernel.org/r/20170217081742.17417-3-namhyung@kernel.org [ Adjust fuzz on tools/perf/util/pmu.c, add > 0 checks in many other places ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/pmu-events/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/pmu-events') diff --git a/tools/perf/pmu-events/json.c b/tools/perf/pmu-events/json.c index f67bbb0aa36e..0544398d6e2d 100644 --- a/tools/perf/pmu-events/json.c +++ b/tools/perf/pmu-events/json.c @@ -49,7 +49,7 @@ static char *mapfile(const char *fn, size_t *size) int err; int fd = open(fn, O_RDONLY); - if (fd < 0 && verbose && fn) { + if (fd < 0 && verbose > 0 && fn) { pr_err("Error opening events file '%s': %s\n", fn, strerror(errno)); } -- cgit v1.2.3