uts: drop BUG_ON() in copy_utsname()

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@kylinos.cn>
Link: https://patch.msgid.link/20260903064828.126643-3-sunshaojie@kylinos.cn
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Shaojie Sun 2026-09-03 14:48:27 +08:00 committed by Christian Brauner
parent fec2c3c074
commit d54cc3a527
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -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))