aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol-elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol-elf.c')
-rw-r--r--tools/perf/util/symbol-elf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 475d88d0a1c9..562b8ebeae5b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1026,8 +1026,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
1026 curr_dso->long_name_len = dso->long_name_len; 1026 curr_dso->long_name_len = dso->long_name_len;
1027 curr_map = map__new2(start, curr_dso, 1027 curr_map = map__new2(start, curr_dso,
1028 map->type); 1028 map->type);
1029 dso__put(curr_dso);
1029 if (curr_map == NULL) { 1030 if (curr_map == NULL) {
1030 dso__put(curr_dso);
1031 goto out_elf_end; 1031 goto out_elf_end;
1032 } 1032 }
1033 if (adjust_kernel_syms) { 1033 if (adjust_kernel_syms) {
@@ -1042,7 +1042,14 @@ int dso__load_sym(struct dso *dso, struct map *map,
1042 } 1042 }
1043 curr_dso->symtab_type = dso->symtab_type; 1043 curr_dso->symtab_type = dso->symtab_type;
1044 map_groups__insert(kmaps, curr_map); 1044 map_groups__insert(kmaps, curr_map);
1045 /*
1046 * Add it before we drop the referece to curr_map,
1047 * i.e. while we still are sure to have a reference
1048 * to this DSO via curr_map->dso.
1049 */
1045 dsos__add(&map->groups->machine->dsos, curr_dso); 1050 dsos__add(&map->groups->machine->dsos, curr_dso);
1051 /* kmaps already got it */
1052 map__put(curr_map);
1046 dso__set_loaded(curr_dso, map->type); 1053 dso__set_loaded(curr_dso, map->type);
1047 } else 1054 } else
1048 curr_dso = curr_map->dso; 1055 curr_dso = curr_map->dso;