diff options
| author | Srikar Dronamraju <[email protected]> | 2012-05-31 17:16:56 +0530 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2012-05-31 12:08:22 -0300 |
| commit | 378474e4b23183002f1791b294a4440b6b7df36a (patch) | |
| tree | b4a284ead44d6f34b970a38a3710b19e8543b327 | |
| parent | 37073f9e449bc430e6c40b9cffc2558002a0256a (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 <[email protected]>
Suggested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Ananth N Mavinakayanahalli <[email protected]>
Cc: Anton Arapov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
| -rw-r--r-- | tools/perf/util/symbol.c | 5 |
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, struct map *dso__new_map(const char *name) { + struct map *map = NULL; struct dso *dso = dso__new(name); - struct map *map = map__new2(0, dso, MAP__FUNCTION); + + if (dso) + map = map__new2(0, dso, MAP__FUNCTION); return map; } |