diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2010-07-27 23:28:28 -0700 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2010-07-27 23:28:28 -0700 |
| commit | d3608b5681d238605b7da6be62244e803e24c649 (patch) | |
| tree | 1fc47e9f58e6e938eefd40904745a60986739bde /tools/perf/util/symbol.c | |
| parent | 650fb4393dff543bc980d361555c489fbdeed088 (diff) | |
| parent | 113fc5a6e8c2288619ff7e8187a6f556b7e0d372 (diff) | |
Merge remote branch 'origin/x86/urgent' into x86/asm
Diffstat (limited to 'tools/perf/util/symbol.c')
| -rw-r--r-- | tools/perf/util/symbol.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index b63e5713849f..5b276833e2bf 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1443,6 +1443,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, { struct dirent *dent; DIR *dir = opendir(dir_name); + int ret = 0; if (!dir) { pr_debug("%s: cannot open %s dir\n", __func__, dir_name); @@ -1465,8 +1466,9 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name); - if (map_groups__set_modules_path_dir(self, path) < 0) - goto failure; + ret = map_groups__set_modules_path_dir(self, path); + if (ret < 0) + goto out; } else { char *dot = strrchr(dent->d_name, '.'), dso_name[PATH_MAX]; @@ -1487,17 +1489,18 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, dir_name, dent->d_name); long_name = strdup(path); - if (long_name == NULL) - goto failure; + if (long_name == NULL) { + ret = -1; + goto out; + } dso__set_long_name(map->dso, long_name); dso__kernel_module_get_build_id(map->dso, ""); } } - return 0; -failure: +out: closedir(dir); - return -1; + return ret; } static char *get_kernel_version(const char *root_dir) |
