[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <157380361217.29467.17950612808505016356.tip-bot2@tip-bot2>
Date: Fri, 15 Nov 2019 07:40:12 -0000
From: "tip-bot2 for Ian Rogers" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Ian Rogers <irogers@...gle.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>, Jiri Olsa <jolsa@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
linux-kernel@...r.kernel.org
Subject: [tip: perf/core] perf parse: Use YYABORT to clear stack after
failure, plugging leaks
The following commit has been merged into the perf/core branch of tip:
Commit-ID: e1e9b78d3957a267346a86c8f2c433f6a332af65
Gitweb: https://git.kernel.org/tip/e1e9b78d3957a267346a86c8f2c433f6a332af65
Author: Ian Rogers <irogers@...gle.com>
AuthorDate: Fri, 08 Nov 2019 23:58:40 -08:00
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Tue, 12 Nov 2019 08:34:16 -03:00
perf parse: Use YYABORT to clear stack after failure, plugging leaks
Using return rather than YYABORT means that the stack isn't cleared up
following a failure. The change to YYABORT means the return value is 1
rather than -1, but the callers just check for a result of 0 (success).
Add missing free of a list when an error occurs in event_pmu.
Signed-off-by: Ian Rogers <irogers@...gle.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lore.kernel.org/lkml/20191109075840.181231-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/parse-events.y | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 4cac830..e2eea4e 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -284,6 +284,7 @@ PE_NAME opt_pmu_config
do { \
parse_events_terms__delete($2); \
parse_events_terms__delete(orig_terms); \
+ free(list); \
free($1); \
free(pattern); \
YYABORT; \
@@ -550,7 +551,7 @@ tracepoint_name opt_event_config
free($1.event);
if (err) {
free(list);
- return -1;
+ YYABORT;
}
$$ = list;
}
Powered by blists - more mailing lists