lkml.org 
[lkml]   [2019]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 09/16] perf: missed a map__put() in error case
Date
We need to map__put() before returning from failure of
sample__resolve_callchain().

Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
tools/perf/util/hist.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index f9eb95bf3938..ae74b82f51ea 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1062,8 +1062,10 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,

err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent,
iter->evsel, al, max_stack_depth);
- if (err)
+ if (err) {
+ map__put(alm);
return err;
+ }

err = iter->ops->prepare_entry(iter, al);
if (err)
--
2.19.1
\
 
 \ /
  Last update: 2019-03-16 09:08    [W:0.150 / U:1.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site