RE: [PATCH] cgroup: free cset links on find_css_set() failure

From: Kumar, Kaushlendra

Date: Fri Feb 20 2026 - 22:36:13 EST


On <date>, Tejun Heo <tj@xxxxxxxxxx> wrote:
> tmp_links entries are consumed by link_css_set() which
> list_move_tail()'s each entry off tmp_links and into
> cgrp->cset_links and cset->cgrp_links. The BUG_ON
> (!list_empty(&tmp_links)) right after the linking loop
> (line 1281) confirms that tmp_links is empty by the
> time we reach the threaded cset handling code below.
>
> The links, now owned by cset->cgrp_links, are properly
> freed by put_css_set(cset) which is already called on
> this error path.
>
> So the added free_cgrp_cset_links() call would just
> iterate an empty list and is a no-op. There is no leak
> here.

You are right.
put_css_set() already handles the cleanup.

The added call is indeed a no-op. Dropping this patch.

BR,
Kaushlendra