[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <214f9680-b4ce-4c20-85f1-3560624fb49c@linux.dev>
Date: Wed, 21 Jan 2026 07:45:04 -0800
From: Yonghong Song <yonghong.song@...ux.dev>
To: Kery Qi <qikeyu2017@...il.com>, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, shuah@...nel.org
Cc: martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org,
john.fastabend@...il.com, kpsingh@...nel.org, sdf@...ichev.me,
haoluo@...gle.com, jolsa@...nel.org, yatsenko@...a.com, bentiss@...nel.org,
bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf] selftests/bpf: Fix resource leak in serial_test_wq on
attach failure
On 1/21/26 1:41 AM, Kery Qi wrote:
> When wq__attach() fails, serial_test_wq() returns early without calling
> wq__destroy(), leaking the skeleton resources allocated by
> wq__open_and_load(). This causes ASAN leak reports in selftests runs.
>
> Fix this by jumping to a common clean_up label that calls wq__destroy()
> on all exit paths after successful open_and_load.
>
> Note that the early return after wq__open_and_load() failure is correct
> and doesn't need fixing, since that function returns NULL on failure
> (after internally cleaning up any partial allocations).
>
> Fixes: 8290dba51910 ("selftests/bpf: wq: add bpf_wq_start() checks")
> Signed-off-by: Kery Qi <qikeyu2017@...il.com>
Acked-by: Yonghong Song <yonghong.song@...ux.dev>
Powered by blists - more mailing lists