[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1321455099-7110-3-git-send-email-acme@infradead.org>
Date: Wed, 16 Nov 2011 12:51:39 -0200
From: Arnaldo Carvalho de Melo <acme@...radead.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
Anton Blanchard <anton@...ba.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: [PATCH 2/2] perf session: Fix crash with invalid CPU list
From: David Ahern <dsahern@...il.com>
commit 5d67be9 added the option to specify a range of CPUs of interest,
but does not catch an invalid CPU list:
$ perf script -c foo
Segmentation fault (core dumped)
Cc: Anton Blanchard <anton@...ba.org>
Link: http://lkml.kernel.org/r/1321206327-5881-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@...il.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 85c1e6b7..0f4555c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1333,6 +1333,10 @@ int perf_session__cpu_bitmap(struct perf_session *session,
}
map = cpu_map__new(cpu_list);
+ if (map == NULL) {
+ pr_err("Invalid cpu_list\n");
+ return -1;
+ }
for (i = 0; i < map->nr; i++) {
int cpu = map->map[i];
--
1.7.8.rc0.35.gee6df
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists