Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32f0c4cb authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

[NETNS]: Don't memset() netns to zero manually



The newly created net namespace is set to 0 with memset()
in setup_net(). The setup_net() is also called for the
init_net_ns(), which is zeroed naturally as a global var.

So remove this memset and allocate new nets with the
kmem_cache_zalloc().

Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a8891a0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ EXPORT_SYMBOL_GPL(init_net);

static struct net *net_alloc(void)
{
	return kmem_cache_alloc(net_cachep, GFP_KERNEL);
	return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
}

static void net_free(struct net *net)
@@ -90,7 +90,6 @@ static int setup_net(struct net *net)
	struct pernet_operations *ops;
	int error;

	memset(net, 0, sizeof(struct net));
	atomic_set(&net->count, 1);
	atomic_set(&net->use_count, 0);