Thread (3 messages) flat view 3 messages, 2 authors, 2021-08-26

Re: [PATCH] perf bpf: Fix memory leak during synthesis.

From: Ian Rogers <irogers@google.com>
Date: 2021-08-26 18:50:01
Also in: lkml

On Thu, Aug 26, 2021 at 1:02 AM kajoljain [off-list ref] wrote:


On 8/26/21 5:46 AM, Ian Rogers wrote:
quoted
BTF needs to be freed with btf_free.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/bpf-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index cdecda1ddd36..d193104db7f7 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -296,7 +296,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,

 out:
      free(info_linear);
-     free(btf);
+     btf__free(btf);
Hi Ian,
   Patch looks good to me. I can see in one more place we are using free(btf) in the
same file. Can you correct that as well.
Done. Also found 1 more in annotate :-)
https://lore.kernel.org/lkml/20210826184833.408563-1-irogers@google.com/T/#u (local)

Thanks,
Ian
Thanks,
Kajol Jain
quoted
      return err ? -1 : 0;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help