aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 40eeaf07725b..215d50f2042e 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -24,7 +24,7 @@
24#include <sys/utsname.h> 24#include <sys/utsname.h>
25 25
26#ifndef KSYM_NAME_LEN 26#ifndef KSYM_NAME_LEN
27#define KSYM_NAME_LEN 128 27#define KSYM_NAME_LEN 256
28#endif 28#endif
29 29
30#ifndef NT_GNU_BUILD_ID 30#ifndef NT_GNU_BUILD_ID
@@ -46,6 +46,7 @@ struct symbol_conf symbol_conf = {
46 .exclude_other = true, 46 .exclude_other = true,
47 .use_modules = true, 47 .use_modules = true,
48 .try_vmlinux_path = true, 48 .try_vmlinux_path = true,
49 .annotate_src = true,
49 .symfs = "", 50 .symfs = "",
50}; 51};
51 52
@@ -1756,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
1756 struct stat st; 1757 struct stat st;
1757 1758
1758 /*sshfs might return bad dent->d_type, so we have to stat*/ 1759 /*sshfs might return bad dent->d_type, so we have to stat*/
1759 sprintf(path, "%s/%s", dir_name, dent->d_name); 1760 snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name);
1760 if (stat(path, &st)) 1761 if (stat(path, &st))
1761 continue; 1762 continue;
1762 1763
@@ -1765,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
1765 !strcmp(dent->d_name, "..")) 1766 !strcmp(dent->d_name, ".."))
1766 continue; 1767 continue;
1767 1768
1768 snprintf(path, sizeof(path), "%s/%s",
1769 dir_name, dent->d_name);
1770 ret = map_groups__set_modules_path_dir(mg, path); 1769 ret = map_groups__set_modules_path_dir(mg, path);
1771 if (ret < 0) 1770 if (ret < 0)
1772 goto out; 1771 goto out;
@@ -1787,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,
1787 if (map == NULL) 1786 if (map == NULL)
1788 continue; 1787 continue;
1789 1788
1790 snprintf(path, sizeof(path), "%s/%s",
1791 dir_name, dent->d_name);
1792
1793 long_name = strdup(path); 1789 long_name = strdup(path);
1794 if (long_name == NULL) { 1790 if (long_name == NULL) {
1795 ret = -1; 1791 ret = -1;
@@ -2608,10 +2604,10 @@ int symbol__init(void)
2608 symbol_conf.initialized = true; 2604 symbol_conf.initialized = true;
2609 return 0; 2605 return 0;
2610 2606
2611out_free_dso_list:
2612 strlist__delete(symbol_conf.dso_list);
2613out_free_comm_list: 2607out_free_comm_list:
2614 strlist__delete(symbol_conf.comm_list); 2608 strlist__delete(symbol_conf.comm_list);
2609out_free_dso_list:
2610 strlist__delete(symbol_conf.dso_list);
2615 return -1; 2611 return -1;
2616} 2612}
2617 2613