lkml.org 
[lkml]   [2021]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/20] perf test: event_update: fix memory leak of evlist
    Date
    ASan reports a memory leak when running the perf test
    "49: Synthesize attr update" caused by evlist not being deleted.

    This patch adds the missing evlist__delete and removes the
    perf_cpu_map__put since it's already being deleted by evlist__delete.

    Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
    ---
    tools/perf/tests/event_update.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
    index 656218179222cc58..932ab0740d11ced6 100644
    --- a/tools/perf/tests/event_update.c
    +++ b/tools/perf/tests/event_update.c
    @@ -118,6 +118,6 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu
    TEST_ASSERT_VAL("failed to synthesize attr update cpus",
    !perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus));

    - perf_cpu_map__put(evsel->core.own_cpus);
    + evlist__delete(evlist);
    return 0;
    }
    --
    2.31.1
    \
     
     \ /
      Last update: 2021-07-15 18:08    [W:4.846 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site