2014-04-25 00:47:03

by Xiao, Jin

[permalink] [raw]
Subject: [PATCH] cleanup_net: trivial cleanup

Do not initialize net_kill_list twice.
list_replace_init() already takes care of initializing net_kill_list.
We don't need to initialize it with LIST_HEAD() beforehand.

Signed-off-by: xiao jin <[email protected]>
Reviewed-by: David Cohen <[email protected]>
---
net/core/net_namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 81d3a9a..05e949d 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -273,7 +273,7 @@ static void cleanup_net(struct work_struct *work)
{
const struct pernet_operations *ops;
struct net *net, *tmp;
- LIST_HEAD(net_kill_list);
+ struct list_head net_kill_list;
LIST_HEAD(net_exit_list);

/* Atomically snapshot the list of namespaces to cleanup */
--
1.7.9.5


2014-04-26 16:52:11

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] cleanup_net: trivial cleanup

From: xiao jin <[email protected]>
Date: Fri, 25 Apr 2014 08:50:54 +0800

> Do not initialize net_kill_list twice.
> list_replace_init() already takes care of initializing net_kill_list.
> We don't need to initialize it with LIST_HEAD() beforehand.
>
> Signed-off-by: xiao jin <[email protected]>
> Reviewed-by: David Cohen <[email protected]>

Applied, thank you.