[PATCH v2 1/3] cgroup: namespace: drop BUG_ON() in copy_cgroup_ns()
From: Shaojie Sun
Date: Thu Sep 03 2026 - 02:52:18 EST
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@xxxxxxxxxx>
---
kernel/cgroup/namespace.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/cgroup/namespace.c b/kernel/cgroup/namespace.c
index ea4ee13936be..76660332ec64 100644
--- a/kernel/cgroup/namespace.c
+++ b/kernel/cgroup/namespace.c
@@ -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;
--
2.50.1