mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tools: fix crash with invalid CPU list
@ 2011-11-13 17:45 David Ahern
  2011-12-05 12:35 ` [tip:perf/urgent] perf session: Fix " tip-bot for David Ahern
  0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2011-11-13 17:45 UTC (permalink / raw)
  To: acme; +Cc: anton, linux-kernel, David Ahern

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)

Signed-off-by: David Ahern <dsahern@gmail.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.7.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-05 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-13 17:45 [PATCH] perf tools: fix crash with invalid CPU list David Ahern
2011-12-05 12:35 ` [tip:perf/urgent] perf session: Fix " tip-bot for David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome