Re: [PATCH v2 03/16] perf top: Fix sb_evlist leak

From: Namhyung Kim

Date: Sat Jul 04 2026 - 12:55:45 EST


On Tue, Jun 23, 2026 at 10:15:21PM -0700, Ian Rogers wrote:
> Fix a memory leak in cmd_top() where top.sb_evlist was not freed if
> evlist__add_bpf_sb_event() fails. Note that evlist__start_sb_thread() and
> evlist__stop_sb_thread() take ownership of the evlist and free it, so
> we must only free it if we fail before starting the thread.
>
> Assisted-by: Antigravity:gemini-3.1-pro
> Fixes: b38d85ef49cf ("perf bpf: Decouple creating the evlist from adding the SB event")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Looks like a leftover from v1. There are two 03/16 patches. :)

Thanks,
Namhyung