Unverified Commit dc41b844 authored by Christian Brauner's avatar Christian Brauner
Browse files

net: use check_net()



Don't directly acess the namespace count. There's even a dedicated
helper for this.

Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 83914de1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp)
{
	int id;

	if (refcount_read(&net->ns.count) == 0)
	if (!check_net(net))
		return NETNSA_NSID_NOT_ASSIGNED;

	spin_lock(&net->nsid_lock);