mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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>
This commit is contained in:
parent
83914de1c1
commit
dc41b844da
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user