[PATCH] perf pmus: Fixes always false when compare duplicates aliases

Namhyung Kim namhyung at kernel.org
Tue Jun 25 21:01:46 PDT 2024


On Fri, 14 Jun 2024 17:43:18 +0800, Junhao He wrote:

> In the previous loop, all the members in the aliases[j-1] have been freed
> and set to NULL. But in this loop, the function pmu_alias_is_duplicate()
> compares the aliases[j] with the aliases[j-1] that has already been
> disposed, so the function will always return false and duplicate aliases
> will never be discarded.
> 
> If we find duplicate aliases, it skips the zfree aliases[j], which is
> accompanied by a memory leak.
> 
> [...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung



More information about the linux-arm-kernel mailing list