[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1503062000.916566276@decadent.org.uk>
Date: Fri, 18 Aug 2017 14:13:20 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"David Carrillo-Cisneros" <davidcc@...gle.com>,
"Masami Hiramatsu" <mhiramat@...nel.org>,
"Andrew Vagin" <avagin@...nvz.org>,
"Arnaldo Carvalho de Melo" <acme@...hat.com>,
"Andi Kleen" <ak@...ux.intel.com>,
"Wang Nan" <wangnan0@...wei.com>,
"Stephane Eranian" <eranian@...gle.com>,
"Paul Turner" <pjt@...gle.com>,
"Alexander Shishkin" <alexander.shishkin@...ux.intel.com>,
"Simon Que" <sque@...omium.org>, "Jiri Olsa" <jolsa@...nel.org>,
"Peter Zijlstra" <peterz@...radead.org>,
"He Kuang" <hekuang@...wei.com>
Subject: [PATCH 3.16 040/134] perf inject: Don't proceed if
perf_session__process_event() fails
3.16.47-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: David Carrillo-Cisneros <davidcc@...gle.com>
commit bb8d521f77f3e68a713456b7fb1e99f52ff3342c upstream.
All paths following perf_session__process_event() in __cmd_inject() are
useless if __cmd_inject() is to fail, some depend on a correct
session->evlist.
First commit to add code that depends on session->evlist without checking
error was commmit e558a5bd8b ("perf inject: Work with files"). It has
grown since then.
Change __cmd_inject() to fail immediately after
perf_session__process_event() fails.
Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Andrew Vagin <avagin@...nvz.org>
Cc: He Kuang <hekuang@...wei.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Simon Que <sque@...omium.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Wang Nan <wangnan0@...wei.com>
Fixes: e558a5bd8b74 ("perf inject: Work with files")
Link: http://lkml.kernel.org/r/20170410201432.24807-2-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
tools/perf/builtin-inject.c | 2 ++
1 file changed, 2 insertions(+)
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -387,6 +387,8 @@ static int __cmd_inject(struct perf_inje
lseek(file_out->fd, session->header.data_offset, SEEK_SET);
ret = perf_session__process_events(session, &inject->tool);
+ if (ret)
+ return ret;
if (!file_out->is_pipe) {
session->header.data_size = inject->bytes_written;
Powered by blists - more mailing lists