[PATCH v2 0/3] perf tool: Fix multiple memory leakages

Zhongqiu Han posted 3 patches 1 year ago
tools/perf/util/bpf-event.c | 10 ++++++++--
tools/perf/util/env.c       | 13 +++++++++----
tools/perf/util/env.h       |  4 ++--
tools/perf/util/header.c    |  8 ++++++--
4 files changed, 25 insertions(+), 10 deletions(-)
[PATCH v2 0/3] perf tool: Fix multiple memory leakages
Posted by Zhongqiu Han 1 year ago
Fix memory leakages when btf_node or bpf_prog_info_node is duplicated
during insertion into perf_env.

Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
---
v1 -> v2:
- Following Namhyung's review suggestions, optimize patch 3 by removing
  initialization of the return value to true. Instead, use the internal
  function's return value directly and add a blank line between the
  declaration and other statements.
- Add a blank line before the return statement.
- Following Namhyung's review suggestions, fix the incorrect Fixes tags
  for all three patches.
- Link to v1: https://lore.kernel.org/all/20241128125432.2748981-1-quic_zhonhan@quicinc.com/

Zhongqiu Han (3):
  perf header: Fix one memory leakage in process_bpf_btf()
  perf header: Fix one memory leakage in process_bpf_prog_info()
  perf bpf: Fix two memory leakages when calling
    perf_env__insert_bpf_prog_info()

 tools/perf/util/bpf-event.c | 10 ++++++++--
 tools/perf/util/env.c       | 13 +++++++++----
 tools/perf/util/env.h       |  4 ++--
 tools/perf/util/header.c    |  8 ++++++--
 4 files changed, 25 insertions(+), 10 deletions(-)


base-commit: bcf2acd8f64b0a5783deeeb5fd70c6163ec5acd7
-- 
2.25.1
Re: [PATCH v2 0/3] perf tool: Fix multiple memory leakages
Posted by Arnaldo Carvalho de Melo 1 year ago
On Thu, Dec 05, 2024 at 04:44:57PM +0800, Zhongqiu Han wrote:
> Zhongqiu Han (3):
>   perf header: Fix one memory leakage in process_bpf_btf()
>   perf header: Fix one memory leakage in process_bpf_prog_info()
>   perf bpf: Fix two memory leakages when calling
>     perf_env__insert_bpf_prog_info()

Thanks, applied to perf-tools-next,

- Arnaldo