]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nstree: simplify return
authorChristian Brauner <brauner@kernel.org>
Wed, 29 Oct 2025 12:20:20 +0000 (13:20 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 31 Oct 2025 09:16:24 +0000 (10:16 +0100)
node_to_ns() checks for NULL and the assert isn't really helpful and
will have to be dropped later anyway.

Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-7-2e6f823ebdc0@kernel.org
Tested-by: syzbot@syzkaller.appspotmail.com
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
kernel/nstree.c

index b24a320a11a683e7b3645677fbdb06ab72ce8e87..369fd1675c6abbaff4781de322a2fa1af789a4c3 100644 (file)
@@ -194,11 +194,6 @@ struct ns_common *ns_tree_lookup_rcu(u64 ns_id, int ns_type)
                        break;
        } while (read_seqretry(&ns_tree->ns_tree_lock, seq));
 
-       if (!node)
-               return NULL;
-
-       VFS_WARN_ON_ONCE(node_to_ns(node)->ns_type != ns_type);
-
        return node_to_ns(node);
 }