Re: [PATCH 8/9] perf test: Free aliases for PMU event map aliases test

From: John Garry
Date: Mon Sep 07 2020 - 09:58:50 EST


On 07/09/2020 14:20, Namhyung Kim wrote:
I also notice that we have other paths like this, where the allocated
pmu (and aliases) are not freed for later error paths, it seems:

parse_events_add_pmu() -> perf_pmu_find() -> pmu_lookup() ->
pmu_add_cpu_aliases().

I had a quick look at the rest of the series, and could not see if we
fix up any of this.

Hi Namhyung,

Right, I also found that and wondered why ASAN didn't report it.
I think we should free all pmu instances from the pmus list.
But this can be a later work..

ok, good. I was going to say that we could at least add a pmu free helper in pmu.c now (and reference it here, from this test code, for now), but maybe you just want to fix the reported leaks for now and work on this as a follow up.

Thanks,
John