diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/probe-finder.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 3e44a3e36519..573c72363223 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -660,6 +660,7 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
660 | else { | 660 | else { |
661 | /* Search upper class */ | 661 | /* Search upper class */ |
662 | nscopes = dwarf_getscopes_die(sp_die, &scopes); | 662 | nscopes = dwarf_getscopes_die(sp_die, &scopes); |
663 | ret = -ENOENT; | ||
663 | while (nscopes-- > 1) { | 664 | while (nscopes-- > 1) { |
664 | pr_debug("Searching variables in %s\n", | 665 | pr_debug("Searching variables in %s\n", |
665 | dwarf_diename(&scopes[nscopes])); | 666 | dwarf_diename(&scopes[nscopes])); |
@@ -668,14 +669,12 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
668 | pf->pvar->var, 0, | 669 | pf->pvar->var, 0, |
669 | &vr_die)) { | 670 | &vr_die)) { |
670 | ret = convert_variable(&vr_die, pf); | 671 | ret = convert_variable(&vr_die, pf); |
671 | goto found; | 672 | break; |
672 | } | 673 | } |
673 | } | 674 | } |
674 | if (scopes) | 675 | if (scopes) |
675 | free(scopes); | 676 | free(scopes); |
676 | ret = -ENOENT; | ||
677 | } | 677 | } |
678 | found: | ||
679 | if (ret < 0) | 678 | if (ret < 0) |
680 | pr_warning("Failed to find '%s' in this function.\n", | 679 | pr_warning("Failed to find '%s' in this function.\n", |
681 | pf->pvar->var); | 680 | pf->pvar->var); |