summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index cc065d4bfafc..e366e3060e6b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1582,7 +1582,7 @@ int dso__load(struct dso *dso, struct map *map)
bool next_slot = false;
bool is_reg;
bool nsexit;
- int sirc;
+ int sirc = -1;
enum dso_binary_type symtab_type = binary_type_symtab[i];
@@ -1600,16 +1600,14 @@ int dso__load(struct dso *dso, struct map *map)
nsinfo__mountns_exit(&nsc);
is_reg = is_regular_file(name);
- sirc = symsrc__init(ss, dso, name, symtab_type);
+ if (is_reg)
+ sirc = symsrc__init(ss, dso, name, symtab_type);
if (nsexit)
nsinfo__mountns_enter(dso->nsinfo, &nsc);
- if (!is_reg || sirc < 0) {
- if (sirc >= 0)
- symsrc__destroy(ss);
+ if (!is_reg || sirc < 0)
continue;
- }
if (!syms_ss && symsrc__has_symtab(ss)) {
syms_ss = ss;