aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2012-05-31 07:46:56 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-31 11:08:22 -0400
commit378474e4b23183002f1791b294a4440b6b7df36a (patch)
treeb4a284ead44d6f34b970a38a3710b19e8543b327 /tools
parent37073f9e449bc430e6c40b9cffc2558002a0256a (diff)
perf symbols: Check for valid dso before creating map
dso__new() can return NULL. Hence verify dso before creating a new map. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Suggested-by: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Anton Arapov <anton@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20120531114656.23691.54223.sendpatchset@srdronam.in.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/symbol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 9d04dcd91815..3e2e5ea0f03f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2817,8 +2817,11 @@ int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
2817 2817
2818struct map *dso__new_map(const char *name) 2818struct map *dso__new_map(const char *name)
2819{ 2819{
2820 struct map *map = NULL;
2820 struct dso *dso = dso__new(name); 2821 struct dso *dso = dso__new(name);
2821 struct map *map = map__new2(0, dso, MAP__FUNCTION); 2822
2823 if (dso)
2824 map = map__new2(0, dso, MAP__FUNCTION);
2822 2825
2823 return map; 2826 return map;
2824} 2827}