Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: use check_net()

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

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+1 -1
+1 -1
net/core/net_namespace.c
··· 315 315 { 316 316 int id; 317 317 318 - if (refcount_read(&net->ns.count) == 0) 318 + if (!check_net(net)) 319 319 return NETNSA_NSID_NOT_ASSIGNED; 320 320 321 321 spin_lock(&net->nsid_lock);