cgroup: namespace: Drop BUG_ON() in copy_cgroup_ns()

The sole caller, create_new_namespaces(), always passes a valid cgroup
namespace pointer from the task's nsproxy. The other copy_*_ns()
helpers, e.g. copy_time_ns() and copy_pid_ns(), don't perform such a
check either. Drop the BUG_ON() for consistency with them.

Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Shaojie Sun 2026-09-03 14:48:26 +08:00 committed by Tejun Heo
parent 940de590b8
commit 93fccdb045

View File

@ -53,8 +53,6 @@ struct cgroup_namespace *copy_cgroup_ns(u64 flags,
struct ucounts *ucounts;
struct css_set *cset;
BUG_ON(!old_ns);
if (!(flags & CLONE_NEWCGROUP)) {
get_cgroup_ns(old_ns);
return old_ns;