Subject: [PATCH linux-next]cgroup: move list add after list head initilization

From: Li Zhong <[email-masked]>
Date: Wed, 28 Nov 2012 17:15:21 +0800

commit 2243076ad128d0cc196cf6597e6ddcf6bc907676 initialize
cgrp->allcg_node in init_cgroup_housekeeping(). Then in
init_cgroup_root(), we should call init_cgroup_housekeeping() before
adding it to &root->allcg_list. Otherwise, we are initializing an entry
already in a list. 

Signed-off-by: Li Zhong <[email-masked]>
---
 kernel/cgroup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 01d5342..35133cf 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1400,8 +1400,8 @@ static void init_cgroup_root(struct cgroupfs_root *root)
 	root->number_of_cgroups = 1;
 	cgrp->root = root;
 	cgrp->top_cgroup = cgrp;
-	list_add_tail(&cgrp->allcg_node, &root->allcg_list);
 	init_cgroup_housekeeping(cgrp);
+	list_add_tail(&cgrp->allcg_node, &root->allcg_list);
 }
 
 static bool init_root_id(struct cgroupfs_root *root)
-- 
1.7.9.5