Commit d82b853d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pstree: Init pstree_item::list inside __alloc_pstree_item

This is a bit fishy that we do init @children list here
but not @list itself. Better be solid and init everything
in one place.

Also no need to poke @threads and @nr_threads, we're using
xzalloc here anyway.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrey Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9c263a6c
...@@ -38,8 +38,8 @@ struct pstree_item *__alloc_pstree_item(bool rst) ...@@ -38,8 +38,8 @@ struct pstree_item *__alloc_pstree_item(bool rst)
return NULL; return NULL;
INIT_LIST_HEAD(&item->children); INIT_LIST_HEAD(&item->children);
item->threads = NULL; INIT_LIST_HEAD(&item->list);
item->nr_threads = 0;
item->pid.virt = -1; item->pid.virt = -1;
item->pid.real = -1; item->pid.real = -1;
item->born_sid = -1; item->born_sid = -1;
...@@ -148,7 +148,6 @@ int prepare_pstree(void) ...@@ -148,7 +148,6 @@ int prepare_pstree(void)
} }
root_item = pi; root_item = pi;
pi->parent = NULL; pi->parent = NULL;
INIT_LIST_HEAD(&pi->list);
} else { } else {
/* /*
* Fast path -- if the pstree image is not edited, the * Fast path -- if the pstree image is not edited, the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment