aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r--tools/perf/util/probe-finder.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 5d732621a462..74bd2e63c4b4 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -672,7 +672,7 @@ static int find_variable(Dwarf_Die *sc_die, struct probe_finder *pf)
672static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr, 672static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,
673 bool retprobe, struct probe_trace_point *tp) 673 bool retprobe, struct probe_trace_point *tp)
674{ 674{
675 Dwarf_Addr eaddr; 675 Dwarf_Addr eaddr, highaddr;
676 const char *name; 676 const char *name;
677 677
678 /* Copy the name of probe point */ 678 /* Copy the name of probe point */
@@ -683,6 +683,16 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,
683 dwarf_diename(sp_die)); 683 dwarf_diename(sp_die));
684 return -ENOENT; 684 return -ENOENT;
685 } 685 }
686 if (dwarf_highpc(sp_die, &highaddr) != 0) {
687 pr_warning("Failed to get end address of %s\n",
688 dwarf_diename(sp_die));
689 return -ENOENT;
690 }
691 if (paddr > highaddr) {
692 pr_warning("Offset specified is greater than size of %s\n",
693 dwarf_diename(sp_die));
694 return -EINVAL;
695 }
686 tp->symbol = strdup(name); 696 tp->symbol = strdup(name);
687 if (tp->symbol == NULL) 697 if (tp->symbol == NULL)
688 return -ENOMEM; 698 return -ENOMEM;