[PATCH v2 2/3] uts: drop BUG_ON() in copy_utsname()
From: Shaojie Sun
Date: Thu Sep 03 2026 - 02:53:00 EST
The sole caller, create_new_namespaces(), always passes a valid uts
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/utsname.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/utsname.c b/kernel/utsname.c
index ebbfc578a9d3..1ebf87e24607 100644
--- a/kernel/utsname.c
+++ b/kernel/utsname.c
@@ -81,7 +81,6 @@ struct uts_namespace *copy_utsname(u64 flags,
{
struct uts_namespace *new_ns;
- BUG_ON(!old_ns);
get_uts_ns(old_ns);
if (!(flags & CLONE_NEWUTS))
--
2.50.1